Forum > LCL

[beginer] How can i use LCL in a Library ?



I need to use some functions and Objects of the LCL in a Library, but Lazarus don't wants to compile my code.

A Basic example : I can't compile a Library using basic "ShowMessage" function : the "uses dialogs" refers to Dialogs.pas (fpc\2.2.4\source\packages\fv\src) who 's not contening showmessage function. What's wrong ?

Is anyone gets the same problem ? what is the solution ?

Thanx for help !

You need to add the LCL as package dependency to your project.
and you need to add "uses interfaces"

But, be aware => most parts of the LCL do not work in a library

ShowMessage is likely one of the bits that will not work inside a DLL. But I haven't tested, so feel free to try....


[0] Message Index

Go to full version