You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/opt/local
-- The C compiler identification is GNU 8.5.0
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SQLite3: /usr/include (found version "3.26.0")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ur20980/src/oatpp-example-crud/build
$ make -j all
[ 12%] Building CXX object CMakeFiles/crud-lib.dir/src/service/UserService.cpp.o
[ 25%] Building CXX object CMakeFiles/crud-lib.dir/src/ErrorHandler.cpp.o
[ 37%] Linking CXX shared library libcrud-lib.so
[ 37%] Built target crud-lib
[ 50%] Building CXX object CMakeFiles/crud-test.dir/test/tests.cpp.o
[ 62%] Building CXX object CMakeFiles/crud-test.dir/test/UserControllerTest.cpp.o
[ 75%] Building CXX object CMakeFiles/crud-exe.dir/src/App.cpp.o
[ 87%] Linking CXX executable crud-test
/usr/bin/ld: CMakeFiles/crud-test.dir/test/tests.cpp.o: undefined reference to symbol '_ZN5oatpp4test8UnitTest3runEi'
/opt/local/lib64/oatpp-1.3.0/liboatpp-test.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/crud-test.dir/build.make:118: crud-test] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/crud-test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable crud-exe
[100%] Built target crud-exe
make: *** [Makefile:101: all] Error 2
Fix (or a workaround for Linux, need guards for other OSes) is passing the following linker flag:
export LDFLAGS="-Wl,--copy-dt-needed-entries"
I suggest adding the above to the CMakeLists.txt file, and/or to the README.md where you describe how to build it from the source.
Ubuntu-20.04 and Centos-8.
Fix (or a workaround for Linux, need guards for other OSes) is passing the following linker flag:
I suggest adding the above to the
CMakeLists.txt
file, and/or to theREADME.md
where you describe how to build it from the source.Here's the author of this fix: https://zhangboyi.gitlab.io/post/2020-09-14-resolve-dso-missing-from-command-line-error/ and https://stackoverflow.com/questions/19901934/libpthread-so-0-error-adding-symbols-dso-missing-from-command-line
The text was updated successfully, but these errors were encountered: