On Tue, May 07, 2019 at 01:06:09PM -0700, Jeff Moon wrote:
> I'm using chicken 5.0.0.  I've used it to create a handful of apps that I
> have distributed as static binaries, and it seems to be working very well.
> However, when I try to include certain eggs, the static builds do not seem
> to work.  I'm wondering if anybody has gotten static compiles to work with
> any of the following eggs: postgresql, sqlite3, or sql-de-lite?

Hi Jeff,

To get the correct linking options for linking in the libraries you can
use something like:

$ pkg-config --static --libs sqlite3
-lsqlite3 -lm -ldl -lpthread

Then, you can link the program:

$ csc -static -L -lsqlite3 -L -lm -L -ldl -L -lpthread test.scm

You'll note that the libraries are still linked dynamically (with `ldd`).
To make it fully static, use -L -static:

$ csc -static -L -static -L -lsqlite3 -L -lm -L -ldl -L -lpthread test.scm

For PostgreSQL, I used pkg-config --static --libs pq, but this told me
to use -lgssapi_krb5 and there is no static version of that library in
Debian at least.  So I think you can't link it statically on Debian.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to