Error when using dlopen function in ext_modules [message #1862688] |
Wed, 20 December 2023 22:21  |
Eclipse User |
|
|
|
When I try to use the function in the <dlfcn.h> in a custom function block to call the external dynamic link library, I get the following error.
(Generate the Makefile using the CMAKE GUI tool, and the CMAKE_EXE_LINKER_FLAGS -ldl option has been set)
Here is the error info.
[100%] Linking CXX executable forte
/usr/bin/ld: CMakeFiles/FORTE_LITE.dir/ext_modules/DYNAMIC_LIBRARY_TEST/FB_CALL_X2.cpp.o: in function `openlibaray(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/home/imc/work/61499/4diac/forte/source_code/forte_2.0.1/src/ext_modules/DYNAMIC_LIBRARY_TEST/FB_CALL_X2.cpp:45: undefined reference to `dlopen'
/usr/bin/ld: /home/imc/work/61499/4diac/forte/source_code/forte_2.0.1/src/ext_modules/DYNAMIC_LIBRARY_TEST/FB_CALL_X2.cpp:48: undefined reference to `dlerror'
/usr/bin/ld: CMakeFiles/FORTE_LITE.dir/ext_modules/DYNAMIC_LIBRARY_TEST/FB_CALL_X2.cpp.o: in function `callLibaray(void*, char const*, unsigned char*, unsigned char*, unsigned char*)':
/home/imc/work/61499/4diac/forte/source_code/forte_2.0.1/src/ext_modules/DYNAMIC_LIBRARY_TEST/FB_CALL_X2.cpp:57: undefined reference to `dlsym'
/usr/bin/ld: /home/imc/work/61499/4diac/forte/source_code/forte_2.0.1/src/ext_modules/DYNAMIC_LIBRARY_TEST/FB_CALL_X2.cpp:60: undefined reference to `dlerror'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/forte.dir/build.make:328: src/forte] Error 1
make[1]: *** [CMakeFiles/Makefile2:1403: src/CMakeFiles/forte.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24603 seconds