Skip to content

Instantly share code, notes, and snippets.

@vinnix
Created October 9, 2014 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinnix/0568662d5baa46b6c899 to your computer and use it in GitHub Desktop.
Save vinnix/0568662d5baa46b6c899 to your computer and use it in GitHub Desktop.
[ 61%] Built target pganalytics_impl
make[3]: Entering directory `/home/ubuntu/dextra_pganalytics/coletor/build'
make[3]: Leaving directory `/home/ubuntu/dextra_pganalytics/coletor/build'
make[3]: Entering directory `/home/ubuntu/dextra_pganalytics/coletor/build'
Linking CXX executable pganalytics
/usr/bin/ld: util/libpgautil.a(streams.cpp.o): undefined reference to symbol 'inflateInit2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libz.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [src/pganalytics] Error 1
make[3]: Leaving directory `/home/ubuntu/dextra_pganalytics/coletor/build'
make[2]: *** [src/CMakeFiles/pganalytics.dir/all] Error 2
make[2]: Leaving directory `/home/ubuntu/dextra_pganalytics/coletor/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ubuntu/dextra_pganalytics/coletor/build'
make: *** [all] Error 2
@vinnix
Copy link
Author

vinnix commented Oct 9, 2014

16:28 < minoche> vinnix: are you linking to all the dependencies ?
16:28 < PovAddictW> don't poke him into starting a flamewar
16:29 < PovAddictW> vinnix: inflateInit2_? with an underscore at the end? that's weird
16:29 < BadApe> i wan't going to flame him, just wondered what he could possibly run into that makes things different, could be ubuntu has a more up to date library he depends on
16:30 <+ngladitz> is the debian system where it worked pre wheezy?
16:30 < vinnix> sounds like other people had this issue too http://stackoverflow.com/questions/20593423/undefined-reference-to-inflateinit2-zlib-in-c
16:30 < vinnix> I "just" do not know how to fix it
16:31 < BadApe> well look at your installed zlib
16:31 < BadApe> make it is somehow different
16:32 < vinnix> http://pastie.org/9634666 zlib is intalled normally
16:32 < BadApe> i swear there is something weird with msys2, i am sure it doesn't sync it's package list entirely
16:32 < BadApe> is it the same version as the debian version? do the file lists match?
16:33 < BadApe> dpkg -L zlib_package_name
16:34 <+ngladitz> pre-wheezy the linker picked symbols from indirect dependencies; both debian and ubuntu changed that behavior to limit lookups to directly linked libraries
16:35 < vinnix> /usr/lib/x86_64-linux-gnu/libz.so
16:37 -!- tinti [~tinti@pdpc/supporter/student/tinti] has joined #cmake
16:37 < vinnix> https://answers.launchpad.net/ubuntu/+source/zlib/+question/174993
16:38 <+ngladitz> your error indicates you aren't actually linking to zlib
16:39 < vinnix> should I include a "-L /usr/lib/x86_64-linux-gnu/" in somewhere?
16:39 < PovAddictW> instead of guessing
16:39 < PovAddictW> run make VERBOSE=1
16:40 <+ngladitz> is this your project or just something you need to get to build?
16:40 < BadApe> i wonder if i should try visual studio rather than mess with msys2
16:41 < vinnix> is my project, but I am not the main developer, and the guy is in this vacation period :p
16:41 < vinnix> he is the guy who really knows about cmake
16:42 <+ngladitz> there is a find module for zlib: http://www.cmake.org/cmake/help/v3.0/module/FindZLIB.html
16:42 < vinnix> :)
16:42 <+ngladitz> you'd use it with find_package() e.g. find_package(ZLIB REQUIRED)
16:42 <+ngladitz> maybe check if the project already does that somewhere
16:43 <+ngladitz> the module sets the variable ZLIB_LIBRARIES which you can use to link to zlib e.g. target_link_libraries(mytarget ${ZLIB_LIBRARIES})
16:43 < adhok> ok, slightly different problem now. I have successfully gotten the entire project to build now in 2.8.12.2 -> 3.0.2 on both of our target distro's (ubuntu and centos) but I'm
running into a CPack problem when building the RPM.
16:43 < vinnix> let me seek this here, many thanx
16:44 < adhok> The deb builds fine btw :) .. so I'm thinking this is actually an issue with the RPM toolchain and not CPack itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment