I am extremely new to using Makefiles and Autoconf I am using the Camelia Image Library and I I'm trying to link against libraries. When I run "Make" on the Camelia Image Library, I get libcamellia.a, .so, .la, and .o.0.0.0 files inside my / usr / local / lib directory. This command I use to compile my code with my libraries:
gcc -l / usr / local / lib -lcamellia -o myprogram myprogram.c
< / Pre>This works fine, but when I try to link it steady, this is what I get:
gcc -static -l / Usr / local / lib -lCamellia -o myprogram myprogram.c / tmp / cck0pw70.o: function in 'main': myprogram.c :(. Text + 0x23): 'camLoadPGM' myprogram.c :( text + 0x55) Undefined context for: Undefined reference to 'camAllocateImage' myprogram.c : (.text + 0x97): Undefined reference to `camZoom2x 'myprogram.c :( text + 0x104): Undefined reference to` CamSchepGM' is back in 'Exit 2': LD1
I want to link statically because I am trying to modify Camelia source code and I want to compare them against my version. So after some googling, I tried adding AM_DISABLE_SHARED to the configure.in file. But after running .configure, I still get the same Makefile after I "install", I still get the same result above.
What's an easy way to get two versions of my code, compiled with an original Camilla source code and with my revised version? I think static libraries should work. Is static libraries an easy way to work or are there other simple solutions to my problem? I want to compare my version against the original, I do not want to "build" again and again "install".
after adding autoconf
to AM_DISABLE_SHARED
And before configuring, creating, installing? To prevent this from creating a shared library, you can only use configure - disable-dynamic
to make sure that you delete any already installed person - uninstall < / Code> Should I do this clearly I can not clearly see anything wrong: try
GCC -STTITIC -o myprogrammeprogram.c /usr/local/lib/libCamellia.a
Or break it into two steps and myprogram.o
Czech and not symbols nm myprogram.o
. What do you expect with
Comments
Post a Comment