So I've been tinkering with DLLs and Lazarus.. and I came across a problem. It won't let me import graphics. If I do "uses graphics" it says it can't find it. If I include the LCL in the compiler options, it gets an error with other pascal files. If I add graphics as the only compiler option, it'll white 'cause it's not a directory. All I want is my friend, tcanvas :( -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090526/c2e42b8d/attachment.html>
Mailing lists / lazarus / 2009-05
Graphics unit and DLLs
10 messages · 5 people · –
- Mmatt shaffer 5
- PPaul Ishenin 2
- FFelipe Monteiro de Carvalho 1
- MMarco van de Voort 1
- MMattias Gaertner 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Show quoted text 6 lines
I don't know what you mean with 'include the LCL in the compiler options'. Normally you add the LCL via the project inspector to your dependencies.
Mattias
Compiler options as in:Project -> Compiler options . But on second glance, it doesn't appear that that would help anything.
Well what you suggested (Project inspector dependencies) seemed to work. It recognized the graphics unit and let me have a tcanvas variable, and the quick compile worked fine, but the build failed with:
project1.lpr(201,1) Error: Undefined symbol: WSRegisterCustomImageList
project1.lpr(201,1) Error: Undefined symbol: WSRegisterMenuItem
project1.lpr(201,1) Error: Undefined symbol: WSRegisterMenu
project1.lpr(201,1) Error: Undefined symbol: WSRegisterMainMenu
project1.lpr(201,1) Error: Undefined symbol: WSRegisterPopupMenu
project1.lpr(201,1) Error: Undefined symbol: WSRegisterDragImageList
project1.lpr(201,1) Error: Undefined symbol: WSRegisterControl
project1.lpr(201,1) Error: Undefined symbol: WSRegisterWinControl
project1.lpr(201,1) Error: Undefined symbol: WSRegisterGraphicControl
project1.lpr(201,1) Error: Undefined symbol: WSRegisterCustomControl
project1.lpr(201,1) Error: Undefined symbol: WSRegisterScrollingWinControl
project1.lpr(201,1) Error: Undefined symbol: WSRegisterScrollBox
project1.lpr(201,1) Error: Undefined symbol: WSRegisterCustomFrame
project1.lpr(201,1) Error: Undefined symbol: WSRegisterCustomForm
project1.lpr(201,1) Error: Undefined symbol: WSRegisterHintWindow
project1.lpr(201,1) Fatal: There were 15 errors compiling module, stoppingLine 201 is the end of the file "end."
My memory just caught up with me actually: Haven't others discussed how the LCL doesn't work in DLLs? I'm sure they have, and that's what I seem to be trying to do (even if it's just one lowly tcanvas), so I guess it's doomed for failure.
On Tue, May 26, 2009 at 12:40 PM, Mattias Gaertner <
Show quoted text 23 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090526/83c336d3/attachment.html>
matt shaffer wrote 24 lines
If you are using LCL you must add Interfaces unit to your uses section.
Best regards,
Paul Ishenin.
Adding interfaces prevents the errors I was getting previously, but a few
remain:project1.lpr(209,1) Error: Undefined symbol:
RESSTR_LCLSTRCONSTS_RSMBOPEN
project1.lpr(209,1) Error: Undefined symbol: RESSTR_LCLSTRCONSTS_RSMBSAVE
project1.lpr(209,1) Error: Undefined symbol: RESSTR_LCLSTRCONSTS_RSMBUNLOCK
project1.lpr(209,1) Error: Undefined symbol:
RESSTR_LCLSTRCONSTS_RSMTAUTHENTICATIONNot sure as to whether it will work in the DLL or not, but thanks for pointing it out.
Paul Ishenin wrote 38 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090526/42b946a1/attachment-0001.html>
matt shaffer wrote 7 lines
Don't know what is wrong here. That symbols are defined in the LCLStrConsts unit as resource strings. Maybe some fpc problem? Or maybe you need to remove all your .ppu and .o files and try to clean build.
Best regards,
Paul Ishenin.
Doing a clean build worked, thanks.
Paul Ishenin wrote 26 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090526/998366c3/attachment.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.
Ah ok, thanks for clearing that up
On Tue, May 26, 2009 at 9:17 PM, Felipe Monteiro de Carvalho <
Show quoted text 17 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20090526/bfc02d8f/attachment.html>
matt shaffer wroteAh ok, thanks for clearing that up
For more background info, try to read http://wiki.freepascal.org/packages
most notably the part about state and VMTs
