Recent

Author Topic: [beginer] How can i use LCL in a Library ?  (Read 3947 times)

Davidcfres

  • Newbie
  • Posts: 1
[beginer] How can i use LCL in a Library ?
« on: May 09, 2010, 08:53:04 pm »
Hi,

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 !

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9991
  • Debugger - SynEdit - and more
    • wiki
Re: [beginer] How can i use LCL in a Library ?
« Reply #1 on: May 09, 2010, 09:59:36 pm »
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
http://bugs.freepascal.org/view.php?id=7182

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

 

TinyPortal © 2005-2018