I am attempting to build the AR Drone SDK on Ubuntu. When compiling the libraries I get the error:
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
I dont understand what the problem is. I am following this tutorial and the problem occurs when I run make. I have run ARDroneLib/Soft/Build/check_dependencies.sh and it outputs ok.
Any ideas what the problem is? Below is the full output from running make.
soribo#soribo-vm:~/Projects/ARDrone/ARDrone_SDK_2_0_1/Examples/Linux$ make
make[1]: Entering directory `/home/soribo/Projects/ARDrone/ARDrone_SDK_2_0_1/ARDroneLib/Soft/Build'
Libs already extracted
Building target static
Architecture x86_64 is already built
Creating universal static lib file from architectures x86_64
Build done.
Checking required Ubuntu packages ...
ok.
Building ARDroneTool/Lib
Building ARDroneTool/Lib
make[1]: Leaving directory `/home/soribo/Projects/ARDrone/ARDrone_SDK_2_0_1/ARDroneLib/Soft/Build'
make[1]: Entering directory `/home/soribo/Projects/ARDrone/ARDrone_SDK_2_0_1/Examples/Linux/Navigation/Build'
-- Building ardrone_navigation --
Libs already extracted
Building target static
Architecture x86_64 is already built
Creating universal static lib file from architectures x86_64
Build done.
Checking required Ubuntu packages ...
ok.
Building ARDroneTool/Lib
Building ARDroneTool/Lib
-- Linking ardrone_navigation --
ld common/mobile_main
/usr/bin/ld: ../../Soft/Build/targets_versions/ffmpeg_static_PROD_MODE_Linux_3.19.0-25-generic_GNU_Linux_usrbingcc_4.8.4/libavutil.a(eval.o): undefined reference to symbol 'fabs##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[4]: *** [/home/soribo/Projects/ARDrone/ARDrone_SDK_2_0_1/Examples/Linux/Navigation/Build/../../Build/Release/common/mobile_main] Error 1
make[3]: *** [all] Error 2
make[2]: *** [build_app] Error 2
make[1]: *** [ardrone_navigation] Error 2
make[1]: Leaving directory `/home/soribo/Projects/ARDrone/ARDrone_SDK_2_0_1/Examples/Linux/Navigation/Build'
make: *** [all] Error 2
I had the same problem. I found the solution here:
http://jderobot.org/Varribas-tfm/ARDrone:starting_up#Building_Examples
Looking for undefined reference to symbol 'fabs##GLIBC_2.2.5', I reached to [2], that confirms an unmeet dependency problem [1].
What happened here?
libavutil.a(eval.o): undefined reference to symbol 'fabs##GLIBC_2.2.5'
libm.so.6: error adding symbols: DSO missing from command line
First line say us that libavutil is using fabs. It is declared into libm library, but -lm is missed in command line (Makefile).
ARDrone_SDK_2_0_1/Examples/Linux/Navigation/Build/Makefile:131
GENERIC_LIBS+=-liw -lpc_ardrone -lgthread-2.0 -lgtk-x11-2.0 -lrt -lxml2 -ludev -lswscale -lSDL -lm
Then, Navigation will compile successfully.
Related
When I was doing catkin_make in my ROS workspace, following error occurred.
[100%] Linking CXX executable /home/georgehan/catkin_fasttracker/devel/lib/plan_manage/tracking_fsm_node
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
Fast-tracker/src/plan_manage/CMakeFiles/tracking_fsm_node.dir/build.make:832: recipe for target '/home/georgehan/catkin_fasttracker/devel/lib/plan_manage/tracking_fsm_node' failed
make[2]: *** [/home/georgehan/catkin_fasttracker/devel/lib/plan_manage/tracking_fsm_node] Error 1
And by doing locate libgfortran.so, it turns out that there were already libgfortran.so files in my system:
~$ locate libgfortran.so
/usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.so
/usr/lib/x86_64-linux-gnu/libgfortran.so.4
/usr/lib/x86_64-linux-gnu/libgfortran.so.4.0.0
I read about making some symlink to fix my problem, but I do not know the which .so file to link to.
Please help me with specific command line !
I encountered the following error while I was compiling gpfs.
OS:RHEL7.4
GPFS:4.2.1
1.# cd /usr/lpp/mmfs/src/
2.# make LINUX_DISTRIBUTION=REDHAT_AS_LINUX Autoconfig
3.# make World
When the third step occurs, the following error occurs。
DVERBOSETRACE -DLROC -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR()" -fno-stack-protector -Wformat=0 -Wno-format-security -I/usr/lpp/mmfs/src/gpl-linux -c kdump.c
cc kdump.o kdump-kern.o kdump-kern-dwarfs.o -o kdump -lpthread
kdump-kern.o: In function `GetOffset':
kdump-kern.c:(.text+0x9): undefined reference to `page_offset_base'
kdump-kern.o: In function `KernInit':
kdump-kern.c:(.text+0x58): undefined reference to `page_offset_base'
collect2: error: ld returned 1 exit status
make[1]: *** [modules] Error 1
make[1]: Leaving directory `/usr/lpp/mmfs/src/gpl-linux'
make: *** [Modules] Error 1
add unsigned long page_offset_base; on top of the file /usr/lpp/mmfs/src/gpl-linux/kdump.c
i see the same problem compiling with the kernel (3.10.0-693.1.1.el7.x86_64). (rhel7.3 updated + GPFS 4.2.3-1)
I resolved it using a previous kernel: kernel-3.10.0-514.el7.x86_64
I hope this help.
Regards
I am trying to compile Azure storage c++ SDK on Fedora 22. I am using gcc version 5.1.1-1. When I compile test application using following command:
$> CASABLANCA_DIR=/source/codebox/azure/cpprestsdk/ CXX=g++ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=on
$> make
It produces following error message:
/usr/bin/ld: CMakeFiles/azurestoragetest.dir/main.cpp.o: undefined reference to symbol 'pthread_rwlock_wrlock##GLIBC_2.2.5'
/usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
tests/CMakeFiles/azurestoragetest.dir/build.make:879: recipe for target 'Binaries/azurestoragetest' failed
make[2]: *** [Binaries/azurestoragetest] Error 1
CMakeFiles/Makefile2:125: recipe for target 'tests/CMakeFiles/azurestoragetest.dir/all' failed
make[1]: *** [tests/CMakeFiles/azurestoragetest.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
I can see libpthread.so.0 library in /usr/lib64 directory. Which other library I need to install?
Add the right find_package invokation to your CMakeLists.txt:
find_package(Threads)
Then, link the library to your target:
target_link_libraries(my_target ${CMAKE_THREAD_LIBS_INIT})
That's all. Likely you forgot the target_link_libraries.
In general (outside of CMake and Azure Storage SDK), this error indicates you need to link with -lpthread. (With gcc you likely want -pthread.)
I have python2.7.9 on my new Xubuntu installation, albeit it's 14.04.
PySide installation stuck with Shiboken
Linking CXX shared library libshiboken-python2.7.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libshiboken/libshiboken-python2.7.so.1.2.2] Error 1
make[1]: *** [libshiboken/CMakeFiles/libshiboken.dir/all] Error 2
make: *** [all] Error 2
error: Error compiling shiboken
After some "googling" I concluded that the problem could be solved with add --enable-shared at ./configure options.
Following docs tried to installed Shiboken in several ways, but after failed, tried to find configure in source files which I couldn't.
Please help. Thank you.
The output is showing that it's trying to link against a static python library, rather than a shared one - i.e. libpython2.7.a, rather than libpython2.7.so.
Thus, it's python that needs to be re-compiled with --enable-shared, not shiboken.
I'm trying to make a file in Ubuntu and when i make i keep getting this error:
/usr/bin/ld: ../../gtest-1.7.0/libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_key_delete##GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/tests/run_tests] Error 1
make[1]: *** [src/tests/CMakeFiles/run_tests.dir/all] Error 2
make: *** [all] Error 2
I saw someone mentioning to go into Makefile and adding '-L /lib64 -l pthread' to the variable LDFLAGS but how do you do that? Totally new to linux here =X
The above linking problem is solved by adding
-lpthread -lm to CMakeLists.txt (target link libraries for luxrender);
TARGET_LINK_LIBRARIES(... -lpthread -lm)
I hit the same issue: -lpthread should be last in your linking invocation
(has to do with mix of static and shared symbols)
So with CMake: ${CMAKE_THREAD_LIBS_INIT} should be last. For example:
target_link_libraries(mytestlib
${BINARY_DIR}/libgmock.a
glog
gflags
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
And for the OP: Search for "thread" in the CMakeLists.txt for the project your are building and paste those section (or link which project you are trying to build if it is open source) - if the above isn't self explanatory
If you are building with Make or something else, add -pthread to the compilation command line (so GCC would generate thread-safe static locals) and to the linking command line (so GCC would tell the linker to do the right thing, most notably link with -lpthread).
If you are building with CMake - then most probably you need these (full example):
# always
FIND_PACKAGE(Threads REQUIRED)
# if using boost
SET(Boost_USE_MULTITHREADED ON)
TARGET_LINK_LIBRARIES(my_app ... ${CMAKE_THREAD_LIBS_INIT})