Board index » cppbuilder » Static linking with packages - setting this up correctly

Static linking with packages - setting this up correctly

Hi,

I am trying to sort out the detail for linking with runtime packages
statically.  I have .lib files no problem, the issue is one of understanding
exactly what the options in the .bpr file are for.

Adding a library to the project works fine adding a entry in the LIBFILES
portion of the .BPR.
Some people how ever have added .lib files to LIBRARIES and PACKAGES
portions of the file and there the fun starts.  This actually works in that
the static linking takes place.

Editing the .BPR file and adding to LIBRARIES/PACKAGES manually is not
always allowed the IDE will often remove the entries, its got its own idea
fo whats supposed to be there.  I find no documentation for this anywhere.

There seems no mechanism to directly add options here via the IDE, a strong
clue that you arent supposed to do this at all.

No-one currently working on the code can tell me exactly what the entries
are for and that is what prompts my question.  Is there a valid reason to
manually edit the LIBRARIES/PACKAGE entries and if so what is the difference
between that and the LIBFILES entry which you can create by simply adding a
library to a project?

TIA,

    John

 

Re:Static linking with packages - setting this up correctly


My finding is that if your package has a design time interface, and you
have dropped a component from that interface onto a form or data module,
the IDE will automatically search for the appropriate static library
when linking without packages. However if your package just has a
run-time interface, and you normally have added the package to the list
of run-time packages when you link with packages, then when you don't
link with packages the IDE does not look for the appropriate static
library. Instead you have to manually add the static library version of
the package to your project. I never do this by mucking with the .bpr
but simply by adding the .lib file to my project, which adds an
appropriate line to the source file for my project which enables the IDE
to link in that library. And no, I don't know why the IDE was designed
to work easily with run-time packages and not with run-time static lib
versions of packages.
Quote
jfreilly wrote:
> Hi,

> I am trying to sort out the detail for linking with runtime packages
> statically.  I have .lib files no problem, the issue is one of understanding
> exactly what the options in the .bpr file are for.

> Adding a library to the project works fine adding a entry in the LIBFILES
> portion of the .BPR.
> Some people how ever have added .lib files to LIBRARIES and PACKAGES
> portions of the file and there the fun starts.  This actually works in that
> the static linking takes place.

> Editing the .BPR file and adding to LIBRARIES/PACKAGES manually is not
> always allowed the IDE will often remove the entries, its got its own idea
> fo whats supposed to be there.  I find no documentation for this anywhere.

> There seems no mechanism to directly add options here via the IDE, a strong
> clue that you arent supposed to do this at all.

> No-one currently working on the code can tell me exactly what the entries
> are for and that is what prompts my question.  Is there a valid reason to
> manually edit the LIBRARIES/PACKAGE entries and if so what is the difference
> between that and the LIBFILES entry which you can create by simply adding a
> library to a project?

> TIA,

>     John

Other Threads