Debug LCL library lazarus / 12-Debugger ---------------------------------------------------------------------- ShaunS · 2013-06-27 16:22 Hi, I am trying to debug a library that depends on LCL. The only reason it needs the LCL is for generating graphics using canvas functionality. The library works well, but the problem is that I am working blind. The library debugged correctly until I added the LCL dependencies. When I try and debug the library I get: The application was unable to start correctly (0xc0000142). Click Ok to close the application. Windows 7 32 bit Lazarus 1.0.10 FPC 2.6.2 Thank you, Shaun ---------------------------------------------------------------------- Martin_fr · 2013-06-27 18:03 From what I googled you should get this error independent of using a debugger or running without. When debugging, to you use the same app as starter app, that would use the dll outside the debugger? Most stuff I found refers to this error being a dependency issue, some suggesting related to resources. LCL code does actually load resources from the exe, maybe in unit initialization. If so, and if in a dll, then I wonder what it uses for the exe.... Sorry not of much help, but that all I got. ---------------------------------------------------------------------- ShaunS · 2013-07-02 11:27 Hi Martin, Thank you for your help. It allowed me to get to the solution. "From what I googled you should get this error independent of using a debugger or running without." I retested this and you are correct. I always get the error. It turns out that the test app and the DLL both use the LCL. This causes the crash. The main application I use the library in does not use the LCL. This is why it works in the main application. From: http://lists.lazarus.freepascal.org/pipermail/lazarus/2009- May/043313.html The LCL works inside DLLs, I have managed to wrap it and use it in C this way. Basically if either only the library or only the main program use LCL it works, but if both use the LCL, then there are problems with connecting both parts. -- Felipe Monteiro de Carvalho Thanks again, Shaun