stevenlovegrove / Pangolin

Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
MIT License
2.39k stars 855 forks source link

cmake --build . error #920

Closed Shanzhaguoo closed 5 months ago

Shanzhaguoo commented 7 months ago
[ 19%] Building CXX object CMakeFiles/pango_image.dir/components/pango_image/src/image_io_tiff.cpp.o
[ 20%] Linking CXX shared library libpango_image.so
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjpeg.a(jcapimin.c.o): relocation R_X86_64_PC32 against symbol `jpeg_natural_order' 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
make[2]: *** [CMakeFiles/pango_image.dir/build.make:327: libpango_image.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:722: CMakeFiles/pango_image.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I met a problem like this when I use the command"cmake --build .", could you told me how to solve it?

christian-rauch commented 7 months ago

The error message says recompile with -fPIC, but we already compile with CMAKE_POSITION_INDEPENDENT_CODE ON.

Are you using the latest Pangolin version? Did you follow the build instructions? Can you provide details on how you compile?