Recent

Author Topic: using packages in console application  (Read 779 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
using packages in console application
« on: November 16, 2019, 10:44:47 am »
Hi

I create an empty console application and if I add to the project the requirement for some third party packages (e.g zcomponent from ZeosLib, or pack_powerpdf, or others), it compiles but ends with "Error: Error while linking".

Of course, I have no problem with these packages in a normal Application using Forms and LCL.

I guess that those packages are containing or referring somethings not suitable for console applications. However, even with packages containing no register functions and no references to UI stuff, I get the issue.

So, my question is how I can discover what is wrong in this packages.

Thanks for hints
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: using packages in console application
« Reply #1 on: November 16, 2019, 11:19:36 am »
Right-click on the message in the Messages window and choose Copy->Copy All/Original Messages to Clipboard
This gives you a complete (unfiltered) list of messages to inspect.
Often you will then discover which specific library/libraries is/are not found at the linking stage, etc.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: using packages in console application
« Reply #2 on: November 16, 2019, 11:44:11 am »
Open the package in the IDE ("Package" > "Open package file (*.lpk)"). When you see "LCL" among the "Required packages" you usually are out of luck in a console program. Sometimes libraries are split into sub-packages. The main fpspreadsheet package (laz_fpspreadsheet) does not require LCL while laz_fpspreadsheet_visual does.

- ZEOS: zcore.lpk requires LCL  :(
- powerpdf:  pack_powerpdf.lpk requires LCL :(

For pdf generation you could try fcl-pdf which comes with the fpc installation (included in fcl).

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
Re: using packages in console application
« Reply #3 on: November 21, 2019, 05:45:08 pm »
Quote from: wp
you could try fcl-pdf

Do you know if fcl-pdf can be used by lazreport ?
Or by another report generator, although I would not be happy to make again a number of reports...

Thanks
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

 

TinyPortal © 2005-2018