adobe / XMP-Toolkit-SDK

The XMP Toolkit allows you to integrate XMP functionality into your product or solution
BSD 3-Clause "New" or "Revised" License
199 stars 80 forks source link

Error Compiling on Ubuntu 18_04, gcc 7.5.0, XMP version 201607 #42

Closed AlexImagineComm closed 2 years ago

AlexImagineComm commented 3 years ago

This is additional information/bugs for the issue which was closed (? why ?): Compiling on Linux with gcc 7.5.0 ( https://github.com/adobe/XMP-Toolkit-SDK/issues/8 ) . I'm compiling the version XMP-Toolkit-SDK-CC201607. I followed the Readme file and fixed the bugs described here: https://github.com/adobe/XMP-Toolkit-SDK/issues/8. In addition I set up the libuuid as per this description: https://noknow.info/it/os/install_libuuid_from_source?lang=en Here's the gcc version: image I can run "make StaticAll" and it is finished successfully: .ar were created. If I try to build dynamic libs: "make DynamicAll" - I got the following errors: [100%] Linking CXX shared library /home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/public/libraries/i80386linux_x64/release/libXMPFiles.so CMakeFiles/XMPFiles.dir/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/XMPFiles/source/PluginHandler/OS_Utils_Linux.cpp.o: In function `XMP_PLUGIN::GetFunctionPointerFromModuleImpl(void, char const)': OS_Utils_Linux.cpp:(.text+0x25): undefined reference to dlsym' OS_Utils_Linux.cpp:(.text+0x62): undefined reference todlerror' CMakeFiles/XMPFiles.dir/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/XMPFiles/source/PluginHandler/OS_Utils_Linux.cpp.o: In function XMP_PLUGIN::LoadModule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)': OS_Utils_Linux.cpp:(.text+0x51f): undefined reference todlopen' OS_Utils_Linux.cpp:(.text+0x544): undefined reference to dlerror' CMakeFiles/XMPFiles.dir/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/XMPFiles/source/PluginHandler/OS_Utils_Linux.cpp.o: In functionXMP_PLUGIN::UnloadModule(void, bool)': OS_Utils_Linux.cpp:(.text+0x70b): undefined reference to `dlclose' collect2: error: ld returned 1 exit status /home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/XMPFiles/build/gcc/dynamic/i80386linux_64/Release/CMakeFiles/XMPFiles.dir/build.make:2019: recipe for target '/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/public/libraries/i80386linux_x64/release/libXMPFiles.so' failed make[3]: [/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/public/libraries/i80386linux_x64/release/libXMPFiles.so] Error 1 make[3]: Leaving directory '/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/build/gcc/dynamic/i80386linux_64/Release' CMakeFiles/Makefile2:144: recipe for target '/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/XMPFiles/build/gcc/dynamic/i80386linux_64/Release/CMakeFiles/XMPFiles.dir/all' failed make[2]: [/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/XMPFiles/build/gcc/dynamic/i80386linux_64/Release/CMakeFiles/XMPFiles.dir/all] Error 2 make[2]: Leaving directory '/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/build/gcc/dynamic/i80386linux_64/Release' Makefile:83: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/ubuntu/tmp/XMP-Toolkit-SDK-CC201607/XMP-Toolkit-SDK-CC201607/build/gcc/dynamic/i80386linux_64/Release' Makefile:49: recipe for target 'DynamicRelease64' failed make: [DynamicRelease64] Error 2

image

Only libXMPCore.so was created (no libXMPFiles.so). image

Please provide the instructions how I can fix this issue.

AlexImagineComm commented 3 years ago

After investigation and checking the following links: https://stackoverflow.com/questions/27607130/undefined-reference-to-dlsym-and-dlopen https://stackoverflow.com/questions/20369672/undefined-reference-to-dlsym?rq=1 The following fix worked: open build/ProductConfig.cmake file and add the following flags -Wl, --no-as-needed before the -ldl flag. image