Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: Statically linking a specific package in 64 bit project

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 0
John Baird

Posts: 22
Registered: 6/15/09
Statically linking a specific package in 64 bit project  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 1, 2017 1:06 AM
I've just upgraded to Tokyo and am revisiting a problem experienced last year when first building 64 bit GUI apps.

I have a small home built package which I want to statically link. No problem with 32 bit projects, they just statically link it. But for a 64 bit project, everytime I save the project after an IDE build, package.a is written to the <LinkPackageImports> line in the .cbproj file. If I manually edit the .cbproj file, remove this entry, and build via msbuild, the package is statically linked as required and the program will run without the presence of package.bpl. But building in the IDE always results in a dependency on package.bpl, and building in the IDE followed by saving the project always results in package.a being added back to the <LinkPackageImports> line. I can add package.a to the list of project files, or add "#pragma comment (lib, "package.a")" to the source, and the change in executable size suggests the package is statically linked. But the presence of package.a in the <LinkPackageImports> line, causes the executable to still require package.bpl even when it is statically linked.

When I view Project options -> Packages -> Runtime Packages ->Runtime package import libraries, package.a does not appear in the list.

So: How do I tell the IDE that for a 64 bit project I want to statically link one particular package?

Or do we have a bug here that the linker is creating an unnecessary dependency when the package is statically linked?

TIA, John
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02