Loic wrote:
> I Have a problem...
> I was able to create the .a files with --disable-shared
> 
> When I run the executable on the same system than the one on which the .a 
> have been created,
> It works --> It compiles and when I check with lld what are the shared 
> library linked to my executable, I do not see anymore: png, jpeg, zlib

[ldd output elided...]

> BUT when I try to compile the code on an other system, I have the following 
> error:
> 
> 
> g++ -Wall -o frog frog.cpp -DFROG_OPENGL -DFROG_ZLIB -DFROG_LIGHTING 
> -DFROG_CURL -IIncludes/FLTK/ -O3 -funroll-loops -s -Dlinux  
> -L/tmp/querten/FROG/frog/Lib -lglut -L/usr/lib64 -L/usr/X11/lib64 
> -L/usr/X11R6/lib64 -lGLU -lGL -LIncludes/FLTK/lib -lfltk_images -lfltk_png 
> -lfltk_z -lfltk_jpeg -lfltk -lfltk_forms -lfltk_gl -lm -lX11 -lfrog -pthread 
> -LIncludes/CURL/Lib -lcurl -LIncludes/FLTK/lib -lfltk_png -lfltk_z -lfltk_gl 
> -lfltk_jpeg
> /usr/bin/ld: skipping incompatible Includes/FLTK/lib/libfltk_images.a when 
> searching for -lfltk_images
> /usr/bin/ld: skipping incompatible Includes/FLTK/lib/libfltk_images.a when 
> searching for -lfltk_images
> /usr/bin/ld: cannot find -lfltk_images
> collect2: ld returned 1 exit status
> make: *** [all] Error 1
> 
> Any Idea?

How did you create this
"incompatible Includes/FLTK/lib/libfltk_images.a" ?

Did you move it from one system to another, maybe with ftp? What are the 
differences of the two systems? Different compilers or other parts of 
the build system? 32/64 bit systems? You probably need to compile the 
libs on your "other" system before linking with them.

Also, your g++ command line looks somewhat odd, because there are 
multiple occurrences of "-LIncludes/FLTK/lib" and the following libs.

> It is ofcourse really needed to make it running on different 
> system/distribution  (that's actually why I'd like to move to static library)

To "make it running on different system/distribution" doesn't mean that 
you must compile and link it on each of these systems, does it? Try to 
compile and link all needed libs on all _different_ platforms (e.g. 
32-bit and 64-bit platforms, and maybe different distributions, because 
of older and/or newer system libs), and then link your application 
program with the static libs on each (really) different platform. After 
this, you should be able to *run* the correct executable on each similar 
platform (i.e. with compatible system libs) as the one you linked it.

HTH

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to