0

I am currently trying to import some libraries into my Gwan C script. I have read through the manual and am using #pragma include to include the folder that my libraries are in, and then use #pragma link to actually include the libraries, but when I run the script it error and says /usr/bin/ld: cannot find -lxxxx.a

Heres current code

#pragma include "/opt/Gwan/libraries/xxx"
#pragma link "xxxx.a"

current Gwan version 4.3.11. Thanks, any help will be appreciated

[EDIT] All is working fine now, changed all my libraries to shared and placed them in /usr/lib

John-Alan
  • 171
  • 7

1 Answers1

0

While you can link object code and static libraries with G-WAN scripts, you should rather use a dynamic library because it will only be loaded once in memory.

Do you succeed in running the (many) G-WAN examples that use third-party libraries? (libsqlite, libcairo, libmySQL, libcURL, liboauth, libmemchached, ImageMagick, etc.)

Don't forget that you must indicate the library file name without the starting "lib" prefix (ie: sqlite3 for libsqlite3.so).

Also, libraries compiled for 64-bit won't work with G-WAN 32-bit (and vice-versa).

If this can help, there's a G-WAN FAQ dedicated on libraries which gives tips and tools to check for possible problems.

Maybe you should give the whole library names instead of the xxx in your example.

Gil
  • 3,279
  • 1
  • 15
  • 25