troosh / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

third-party lib order #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

http://groups.google.com/group/openjpeg/browse_thread/thread/b162c64ddfefe2f8

I've just checkout the trunk.
Then i've run "cmake -DBUILD_THIRDPARTY:BOOL=on ."
But i had a problem at linking time. Indeed in 
codec/CMakeFiles/j2k_dump.dir/link.txt libz is included before libpng. It 
should be placed after because libpng depends on libz.

error message :

Linking C executable ../../bin/image_to_j2k
../../thirdparty/lib/libpng.a(png.c.o): In function `png_reset_crc':
png.c:(.text+0x1c2): undefined reference to `crc32'
../../thirdparty/lib/libpng.a(png.c.o): In function `png_calculate_crc':
png.c:(.text+0x24a): undefined reference to `crc32'
../../thirdparty/lib/libpng.a(png.c.o): In function `png_reset_zstream':
png.c:(.text+0xe0a): undefined reference to `inflateReset'
../../thirdparty/lib/libpng.a(pngread.c.o): In function 
`png_create_read_struct_2':
pngread.c:(.text+0x36e): undefined reference to `inflateInit_'
../../thirdparty/lib/libpng.a(pngread.c.o): In function `png_read_row':
pngread.c:(.text+0x1523): undefined reference to `inflate'
../../thirdparty/lib/libpng.a(pngread.c.o): In function `png_read_destroy':
pngread.c:(.text+0x27ba): undefined reference to `inflateEnd'
../../thirdparty/lib/libpng.a(pngrutil.c.o): In function `png_inflate':
pngrutil.c:(.text+0x3ed): undefined reference to `inflate'
pngrutil.c:(.text+0x499): undefined reference to `inflateReset'
../../thirdparty/lib/libpng.a(pngrutil.c.o): In function `png_read_finish_row':
pngrutil.c:(.text+0x5ea1): undefined reference to `inflate'
pngrutil.c:(.text+0x602c): undefined reference to `inflateReset'
../../thirdparty/lib/libpng.a(pngwrite.c.o): In function `png_write_flush':
pngwrite.c:(.text+0x175e): undefined reference to `deflate'
../../thirdparty/lib/libpng.a(pngwrite.c.o): In function `png_write_destroy':
pngwrite.c:(.text+0x19e0): undefined reference to `deflateEnd'
../../thirdparty/lib/libpng.a(pngwutil.c.o): In function `png_text_compress':
pngwutil.c:(.text+0x41a): undefined reference to `deflate'
pngwutil.c:(.text+0x5df): undefined reference to `deflate'
../../thirdparty/lib/libpng.a(pngwutil.c.o): In function 
`png_write_compressed_data_out':
pngwutil.c:(.text+0x8fd): undefined reference to `deflateReset'
../../thirdparty/lib/libpng.a(pngwutil.c.o): In function `png_write_IHDR':
pngwutil.c:(.text+0xde1): undefined reference to `deflateInit2_'
../../thirdparty/lib/libpng.a(pngwutil.c.o): In function `png_write_finish_row':
pngwutil.c:(.text+0x391a): undefined reference to `deflate'
pngwutil.c:(.text+0x3a1f): undefined reference to `deflateReset'
../../thirdparty/lib/libpng.a(pngwutil.c.o): In function 
`png_write_filtered_row':
pngwutil.c:(.text+0x5497): undefined reference to `deflate'
collect2: ld a retourné 1 code d'état d'exécution
make[2]: *** [bin/image_to_j2k] Erreur 1
make[1]: *** [applications/codec/CMakeFiles/image_to_j2k.dir/all] Erreur 2
make: *** [all] Erreur 2

and codec/CMakeFiles/j2k_dump.dir/link.txt

/usr/bin/gcc      CMakeFiles/j2k_dump.dir/j2k_dump.c.o 
CMakeFiles/j2k_dump.dir/convert.c.o CMakeFiles/j2k_dump.dir/index.c.o 
CMakeFiles/j2k_dump.dir/__/common/color.c.o 
CMakeFiles/j2k_dump.dir/__/common/opj_getopt.c.o  -o ../../bin/j2k_dump 
-rdynamic ../../bin/libopenjpeg.so.1.99.0 ../../thirdparty/lib/libz.a 
../../thirdparty/lib/libpng.a ../../thirdparty/lib/libtiff.a 
../../thirdparty/lib/liblcms2.a -lm 
-Wl,-rpath,/home/maximilien/Projects/OpenJPEG/bin:

Original issue reported on code.google.com by anto...@gmail.com on 11 Feb 2012 at 9:40

GoogleCodeExporter commented 9 years ago

Original comment by anto...@gmail.com on 20 Feb 2012 at 4:18

GoogleCodeExporter commented 9 years ago
Cannot reproduce today using:

URL: https://openjpeg.googlecode.com/svn/trunk
Revision: 1690

and

$ cmake --version
cmake version 2.8.7

It shows as:

cd /home/mathieu/Projects/OpenJPEG/svn/trunk/bin-static/applications/codec && 
/usr/bin/cmake -E cmake_link_script CMakeFiles/j2k_dump.dir/link.txt --verbose=1
/usr/bin/gcc     -Wl,--no-as-needed CMakeFiles/j2k_dump.dir/j2k_dump.c.o 
CMakeFiles/j2k_dump.dir/convert.c.o CMakeFiles/j2k_dump.dir/index.c.o 
CMakeFiles/j2k_dump.dir/__/common/color.c.o 
CMakeFiles/j2k_dump.dir/__/common/opj_getopt.c.o  -o ../../bin/j2k_dump 
-rdynamic ../../bin/libopenjpeg.so.1.99.0 ../../thirdparty/lib/libpng.a 
../../thirdparty/lib/libtiff.a ../../thirdparty/lib/liblcms2.a 
../../thirdparty/lib/libz.a -lm 
-Wl,-rpath,/home/mathieu/Projects/OpenJPEG/svn/trunk/bin-static/bin: 

Original comment by mathieu.malaterre on 29 May 2012 at 1:10