Martchus / tagparser

C++ library for reading and writing MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
GNU General Public License v2.0
127 stars 17 forks source link

Error building on Ubuntu 16.10 #6

Closed guss77 closed 7 years ago

guss77 commented 7 years ago

When building on Ubuntu 16.10 ,I get the following error:

[100%] Linking CXX shared library libtagparser.so
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libz.a(deflate.o): relocation R_X86_64_PC32 against symbol `z_errmsg' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/tagparser.dir/build.make:1630: recipe for target 'libtagparser.so.6.4.0' failed
make[2]: *** [libtagparser.so.6.4.0] Error 1
CMakeFiles/Makefile2:170: recipe for target 'CMakeFiles/tagparser.dir/all' failed
make[1]: *** [CMakeFiles/tagparser.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

I've checked libz and it is fPICed just fine.

Martchus commented 7 years ago

Which commands do you use exactly to trigger the build?

I suspect STATIC_LIBRARY_LINKAGE is enabled or zlib is only available as static library. At least the build system attempts to link against the static version of zlib. This is usually not what you want when packaging a shared library for a Linux distro. For the variables controlling whether to build static or dynamic libs and whether to link against dependencies statically or dynamically checkout the documentation.

From the error message I would tell the objects in the static zlib library are not PICed. How do you come to the conclusion "it is PICed just fine"? Maybe only the shared zlib library is PICed?

Martchus commented 7 years ago

I'm closing this because you didn't respond and from my side it looks like this issue is simply caused by trying link the dynamic tagparser library against a static, unrelocatable zlib.

If you need any further help, feel free to repoen.

jaresh407 commented 7 years ago

Thank you. Sorry for not responding back. I apologize.

On Aug 28, 2017 7:42 PM, "Martchus" notifications@github.com wrote:

I'm closing this because you didn't respond and from my side it looks like this issue is simply caused by trying link the dynamic tagparser library statically against an unrelocatable zlib.

If you need any further help, feel free to repoen.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Martchus/tagparser/issues/6#issuecomment-325513098, or mute the thread https://github.com/notifications/unsubscribe-auth/ABrmGyf3jzVyi7jdHBWN7mptQPOOCUR2ks5sc1BogaJpZM4OQ3bg .