Linux error adding symbols dso missing from command line

Linking error: DSO missing from command line

I am rather new to Linux (using Ubuntu 14.04 LTS 64bit), coming from Windows, and am attempting to port over an existing CUDA project of mine.

When linking via

I encounter the following error:

The answer seems closely related to the solutions in this post (Strange linking error: DSO missing from command line), though given my inexperience with Linux I was unable to adapt them to my own problem.

Any ideas on what the problem could be?

4 Answers 4

Hopefully this will be of help to those, like me, who are new to Linux and don’t find anything related to Linux to be particularly obvious.

As noted by talonmies, I am not able to link indirectly and as such need to specify any additional libraries required by the libraries I am using. That is to say, if I link library A, which requires libraries B and C, I need to link all three libraries for the program to link correctly.

To find what other libraries were needed I used the pkg-config command, for which I found a guide here. Running pkg-config —print-requires —print-requires-private glfw3 gave the following output, which is the list of packages required by glfw3.

I was then able to find what libraries I needed to include by running pkg-config —libs , followed by the name of the library. For example, pkg-config —libs x11 yielded -lX11 .

Note: you can pass multiple items to pkg-config as input, so running

will print out all the additional libraries you need to link ( -lX11 -lXrandr -lXi -lXxf86vm -lGL ).

My program now links successfully, I hope this helpful to anyone with a similar problem.

Источник

libpthread.so.0: error adding symbols: DSO missing from command line

When I’m compiling openvswitch-1.5.0, I’ve encountered the following compile error:

If I try to see the symbols of libpthread , it looks fine.

Could you give any hints or pointers?

16 Answers 16

You should mention the library on the command line after the object files being compiled:

Explanation: the linking is dependent on the order of modules. Symbols are first requested, and then linked in from a library that has them. So you have to specify modules that use libraries first, and libraries after them. Like this:

Moreover, in case there’s a circular dependency, you should specify the same library on the command line several times. So in case libb needs symbol from libc and libc needs symbol from libb , the command line should be:

The error message depends on distribution / compiler version:

Читайте также:  Adobe acrobat reader для linux

Ubuntu Raring: (more informative)

Solution: You may be missing a library in your compilation steps, during the linking stage. In my case, I added ‘-lz’ to makefile / GCC flags.

Background: DSO is a dynamic shared object or a shared library.

Background

The DSO missing from command line message will be displayed when the linker does not find the required symbol with it’s normal search but the symbol is available in one of the dependencies of a directly specified dynamic library.

In the past the linker considered symbols in dependencies of specified languages to be available. But that changed in some later version and now the linker enforces a more strict view of what is available. The message thus is intended to help with that transition.

What to do?

If you are the maintainer of the software

You should solve this problem by making sure that all libraries that are needed to satisfy the needed symbols are directly specified on the linker command line. Also keep in mind that order often matters.

If you are just trying to compile the software

As a workaround it’s possible to switch back to the more permissive view of what symbols are available by using the option -Wl,—copy-dt-needed-entries .

Common ways to inject this into a build are to export LDFLAGS before running configure or similar like this:

Sometimes passing LDFLAGS=»-Wl,—copy-dt-needed-entries» directly to make might also work.

18.04.1) didn’t recognize this flag.

I found another case and therefore I thing you are all wrong.

This is what I had:

The problem is that the command line DID NOT contain -lX11 — although the libX11.so should be added as a dependency because there were also GTK and GNOME libraries in the arguments.

So, the only explanation for me is that this message might have been intended to help you, but it didn’t do it properly. This was probably simple: the library that provides the symbol was not added to the command line.

Please note three important rules concerning linkage in POSIX:

  • Dynamic libraries have defined dependencies, so only libraries from the top-dependency should be supplied in whatever order (although after the static libraries)
  • Static libraries have just undefined symbols — it’s up to you to know their dependencies and supply all of them in the command line
  • The order in static libraries is always: requester first, provider follows. Otherwise you’ll get undefined symbol message, just like when you forgot to add the library to the command line
  • When you specify the library with -l , you never know whether it will take lib .so or lib .a . The dynamic library is preferred, if found, and static libraries only can be enforced by compiler option — that’s all. And whether you have any problems as above, it depends on whether you had static or dynamic libraries
  • Well, sometimes the dependencies may be lacking in dynamic libraries 😀

Источник

error adding symbols: DSO missing from command line #95

Comments

driesken commented Jan 31, 2015

I’ve installed all required packages and retrieved the latest code using git.

The autogen goes well, but ‘make’ is throwing me this error:

libtools/oldmega.c:1419:15: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]
GSList i, *prev, *next;
^
CC libtools/tools.o
CCLD megadf
/usr/bin/ld: libtools/oldmega.o: undefined reference to symbol ‘g_input_stream_get_type’
//usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *
* [megadf] Error 1
make: *** [all] Error 2

Is this some kind of bug?

The text was updated successfully, but these errors were encountered:

megous commented Jan 31, 2015

What OS are you using?

driesken commented Jan 31, 2015

Currently Ubuntu 14.04

megous commented Jan 31, 2015

Weird, build works for me on that system. Though I’m only using the official tarball. Can you please confirm that official tarball build works on your system?

Can you also run make with:

and paste the output before the error happens.

megous commented Jan 31, 2015

Might be you’re missing some autotools related stuff on your system, before running autogen.sh. I’ve seen issues where ./autogen.sh succeeds but results in unusable Makefile/configure.

Читайте также:  Настройки windows во весь экран

driesken commented Jan 31, 2015

Here is the output you requested:
root@thinkpad:/home/ddegendt/Documents/megatools# make V=1
libtool: link: gcc -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I./libtools -I./mega -I. -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-unused-local-typedefs -Wno-sign-compare -Wno-pointer-sign -Wno-missing-field-initializers -o .libs/megadf tools/df.o libtools/sjson.gen.o libtools/http.o libtools/oldmega.o libtools/tools.o ./.libs/libmega.so -pthread
/usr/bin/ld: libtools/oldmega.o: undefined reference to symbol ‘g_input_stream_get_type’
//usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [megadf] Error 1
make: *** [all] Error 2

Have never used autogen before so I don’t have any experience with it.

The tarball works fine, thanks!

megous commented Feb 1, 2015

Yeah, I have no clue. Most probably it is some missing dependency.

Ubuntu/Debian is kind of fragile in this, because it splits packages into many pieces, and if you don’t know exactly what you’re doing, you’ll get bitten like this.

crabkalash commented Feb 4, 2015

Hey, got the same error on 14.04. Installed from tarball went flawlessly.

gnwp commented Feb 6, 2015

try: ./configure —disable-shared —enable-static

this has worked for me.

mathstuf commented Oct 19, 2015

(Found this searching for what ended up causing these issues.)

Anyways, the problem here is that the link line is missing -lgio because you use symbols from it. It used to be that the linker would see that some other library linked gio and the linker would be happy with that. Now, you use those symbols, so you must link gio specifically.

Источник

make: error adding symbols: DSO missing from command line #110

Comments

alvassin commented Jun 14, 2015

Installing on debian 8.

Following installation process:

Gives following error:

The text was updated successfully, but these errors were encountered:

karlheyes commented Jun 14, 2015

Can you send me the config.log for this, it may be just an ordering issue on the link line that is being thrown up unlike before.

alvassin commented Jun 14, 2015

karlheyes commented Jun 14, 2015

can you download the replacement configure I have uploaded, drop into the build directory and rerun it and then make. It’s basically the same just a reorder of ssl and curl tests.

alvassin commented Jun 14, 2015

Replaced build dir with new one from tarball, replaced configure script, result is still the same, DSO missing from command line.

karlheyes commented Jun 14, 2015

should I take it that the following works

alvassin commented Jun 14, 2015

@karlheyes This worked fine! Thanks a lot for help.

karlheyes commented Jun 14, 2015

I suspect it’s dependencies in either libcurl or libssl being reported incorrectly. The configure queries what is installed and the requirements for those, so libcrypto should be getting listed if it is not automatically searched, but it seems something is out of sync, but whether it is down to the linker search, the libtool or library spec for pkg-config, not sure yet.

alvassin commented Jun 14, 2015

@karlheyes i tried to reinstall from clean snapshot, but using apt-get install pkg-config before icecast make. That way i can just execute make without parameters, and it will work fine.

Источник

Compile error: libboost_system.so.1.58.0: error adding symbols: DSO missing from command line #346

Comments

jianweike commented Jun 26, 2018 •

Specifications like the version of the project, operating system, and hardware

Steps to reproduce the problem

I could compile and use OpenMVS both in Debug and Release mode, but recently when I tried to recompile OpenMVS, linking error happens. It seems like something unexpected going on when linking boost.

I followed exactly the instructions in https://github.com/cdcseacave/openMVS/wiki/Building.
Then cmake
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT=»$main_path/vcglib» -DBUILD_SHARED_LIBS=ON

[ 78%] Linking CXX executable ../../bin/ReconstructMesh
/usr/bin/ld: CMakeFiles/ReconstructMesh.dir/ReconstructMesh.cpp.o: undefined reference to symbol ‘_ZN5boost6system15system_categoryEv’
//usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
apps/ReconstructMesh/CMakeFiles/ReconstructMesh.dir/build.make:95: recipe for target ‘bin/ReconstructMesh’ failed
make[2]: *** [bin/ReconstructMesh] Error 1
CMakeFiles/Makefile2:711: recipe for target ‘apps/ReconstructMesh/CMakeFiles/ReconstructMesh.dir/all’ failed
make[1]: *** [apps/ReconstructMesh/CMakeFiles/ReconstructMesh.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs.
[ 80%] Linking CXX executable ../../bin/InterfaceVisualSFM
/usr/bin/ld: CMakeFiles/InterfaceVisualSFM.dir/InterfaceVisualSFM.cpp.o: undefined reference to symbol ‘_ZN5boost6system15system_categoryEv’
//usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
apps/InterfaceVisualSFM/CMakeFiles/InterfaceVisualSFM.dir/build.make:95: recipe for target ‘bin/InterfaceVisualSFM’ failed
make[2]: *** [bin/InterfaceVisualSFM] Error 1
CMakeFiles/Makefile2:601: recipe for target ‘apps/InterfaceVisualSFM/CMakeFiles/InterfaceVisualSFM.dir/all’ failed
make[1]: *** [apps/InterfaceVisualSFM/CMakeFiles/InterfaceVisualSFM.dir/all] Error 2
[ 81%] Linking CXX executable ../../bin/DensifyPointCloud
/usr/bin/ld: CMakeFiles/DensifyPointCloud.dir/DensifyPointCloud.cpp.o: undefined reference to symbol ‘_ZN5boost6system15system_categoryEv’
//usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/build.make:95: recipe for target ‘bin/DensifyPointCloud’ failed
make[2]: *** [bin/DensifyPointCloud] Error 1
CMakeFiles/Makefile2:656: recipe for target ‘apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/all’ failed
make[1]: *** [apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/all] Error 2
Makefile:127: recipe for target ‘all’ failed
make: *** [all] Error 2

Читайте также:  Настройка прокси сервера windows 10 вручную

Thank you all in advanced.

The text was updated successfully, but these errors were encountered:

jianweike commented Jun 27, 2018

In my project I also tried to link openmvs as third library. It was fine before until recently linking error happens. I couldn’t recall what I changed.
usr/bin/ld: warning: libopencv_videoio.so.3.2, needed by /usr/local/lib/libOpenImageIO.so, may conflict with libopencv_videoio.so.3.3
/usr/bin/ld: warning: libopencv_imgproc.so.3.2, needed by /usr/local/lib/libOpenImageIO.so, may conflict with libopencv_imgproc.so.3.3
/usr/bin/ld: warning: libopencv_core.so.3.2, needed by /usr/local/lib/libOpenImageIO.so, may conflict with libopencv_core.so.3.3
/usr/bin/ld: warning: libopencv_imgcodecs.so.3.2, needed by /usr/local/lib/libopencv_videoio.so.3.2, may conflict with libopencv_imgcodecs.so.3.3
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function SEACAVE::Util::Progress::process()’: SceneDensify.cpp:(.text._ZN7SEACAVE4Util8Progress7processEv[_ZN7SEACAVE4Util8Progress7processEv]+0x40): undefined reference to SEACAVE::Timer::GetTimeFactor()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function SEACAVE::Util::Progress::close()’: SceneDensify.cpp:(.text._ZN7SEACAVE4Util8Progress5closeEv[_ZN7SEACAVE4Util8Progress5closeEv]+0x38): undefined reference to SEACAVE::Timer::GetTimeFactor()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function DepthMapsData::FilterDepthMap(MVS::DepthData&, SEACAVE::cList const&, bool)’: SceneDensify.cpp:(.text._ZN13DepthMapsData14FilterDepthMapERN3MVS9DepthDataERKN7SEACAVE5cListIjjLi0ELi16EmEEb+0x187b): undefined reference to SEACAVE::Timer::GetTimeFactor()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function MVS::Scene::DenseReconstructionFilter(void*)’: SceneDensify.cpp:(.text._ZN3MVS5Scene25DenseReconstructionFilterEPv+0x57): undefined reference to SEACAVE::EventQueue::GetEvent(unsigned int)’
SceneDensify.cpp:(.text._ZN3MVS5Scene25DenseReconstructionFilterEPv+0x9b): undefined reference to SEACAVE::EventQueue::GetEvent(unsigned int)’ SceneDensify.cpp:(.text._ZN3MVS5Scene25DenseReconstructionFilterEPv+0xd1): undefined reference to SEACAVE::EventQueue::AddEventFirst(SEACAVE::Event*)’
SceneDensify.cpp:(.text._ZN3MVS5Scene25DenseReconstructionFilterEPv+0xb54): undefined reference to SEACAVE::EventQueue::AddEvent(SEACAVE::Event*)’ SceneDensify.cpp:(.text._ZN3MVS5Scene25DenseReconstructionFilterEPv+0xb7e): undefined reference to SEACAVE::EventQueue::AddEventFirst(SEACAVE::Event*)’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function DepthMapsData::FuseDepthMaps(MVS::PointCloud&, bool)’: SceneDensify.cpp:(.text._ZN13DepthMapsData13FuseDepthMapsERN3MVS10PointCloudEb+0xe63): undefined reference to SEACAVE::Timer::GetTimeFactor()’
SceneDensify.cpp:(.text._ZN13DepthMapsData13FuseDepthMapsERN3MVS10PointCloudEb+0x10dc): undefined reference to SEACAVE::Timer::GetTimeFactor()’ SceneDensify.cpp:(.text._ZN13DepthMapsData13FuseDepthMapsERN3MVS10PointCloudEb+0x238b): undefined reference to SEACAVE::Timer::GetTimeFactor()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function DepthMapsData::InitDepthMap(MVS::DepthData&)’: SceneDensify.cpp:(.text._ZN13DepthMapsData12InitDepthMapERN3MVS9DepthDataE+0xf17): undefined reference to SEACAVE::Timer::GetTimeFactor()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function DepthMapsData::EstimateDepthMap(unsigned int)’: SceneDensify.cpp:(.text._ZN13DepthMapsData16EstimateDepthMapEj+0x1429): undefined reference to SEACAVE::Timer::GetTimeFactor()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function MVS::Scene::DenseReconstructionEstimate(void*)’: SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0x64): undefined reference to SEACAVE::EventQueue::GetEvent()’
SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0xac): undefined reference to SEACAVE::EventQueue::AddEvent(SEACAVE::Event*)’ SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0x6fd): undefined reference to SEACAVE::EventQueue::AddEventFirst(SEACAVE::Event*)’
SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0x73c): undefined reference to SEACAVE::EventQueue::AddEvent(SEACAVE::Event*)’ SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0x82c): undefined reference to SEACAVE::EventQueue::AddEventFirst(SEACAVE::Event*)’
SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0xa45): undefined reference to SEACAVE::EventQueue::AddEvent(SEACAVE::Event*)’ SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0xc0e): undefined reference to SEACAVE::EventQueue::AddEventFirst(SEACAVE::Event*)’
SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0xc41): undefined reference to SEACAVE::Timer::GetTimeFactor()’ SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0xe55): undefined reference to SEACAVE::EventQueue::AddEventFirst(SEACAVE::Event*)’
SceneDensify.cpp:(.text._ZN3MVS5Scene27DenseReconstructionEstimateEPv+0xe8b): undefined reference to SEACAVE::Timer::GetTimeFactor()’ /home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(SceneDensify.cpp.o): In function MVS::Scene::DenseReconstruction()’:
SceneDensify.cpp:(.text._ZN3MVS5Scene19DenseReconstructionEv+0x10d4): undefined reference to SEACAVE::Timer::GetTimeFactor()’ SceneDensify.cpp:(.text._ZN3MVS5Scene19DenseReconstructionEv+0x131c): undefined reference to SEACAVE::Timer::GetTimeFactor()’
SceneDensify.cpp:(.text._ZN3MVS5Scene19DenseReconstructionEv+0x13f0): undefined reference to SEACAVE::EventQueue::AddEvent(SEACAVE::Event*)’ SceneDensify.cpp:(.text._ZN3MVS5Scene19DenseReconstructionEv+0x1784): undefined reference to SEACAVE::EventQueue::IsEmpty() const’
SceneDensify.cpp:(.text._ZN3MVS5Scene19DenseReconstructionEv+0x186a): undefined reference to SEACAVE::EventQueue::AddEvent(SEACAVE::Event*)’ SceneDensify.cpp:(.text._ZN3MVS5Scene19DenseReconstructionEv+0x1ae1): undefined reference to SEACAVE::EventQueue::IsEmpty() const’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(Scene.cpp.o): In function boost::archive::detail::common_iarchive ::

common_iarchive()’: Scene.cpp:(.text._ZN5boost7archive6detail15common_iarchiveINS0_13text_iarchiveEED2Ev[_ZN5boost7archive6detail15common_iarchiveINS0_13text_iarchiveEED5Ev]+0x8): undefined reference to boost::archive::detail::basic_iarchive::

basic_iarchive()’
/home/jianwei/Documents/openMVS-Test/openMVS_build_debug_2/lib/libMVS.a(Scene.cpp.o): In function boost::archive::detail::common_iarchive ::

common_iarchive()’: Scene.cpp:(.text._ZN5boost7archive6detail15common_iarchiveINS0_13text_iarchiveEED0Ev[_ZN5boost7archive6detail15common_iarchiveINS0_13text_iarchiveEED5Ev]+0xc): undefined reference to boost::archive::detail::basic_iarchive::

liumarcus70s commented Jul 5, 2018 •

I got the same issue. Did u figure out the answer?

jianweike commented Jul 5, 2018

I used to update boost to 1.63, and the error was gone, but recently even with 1.63, the error occurs again. The good news is that the library can still be compiled if I don’t linked to my program as third party, so I just modified the the Cmake and the source in application folder based on my needs.

PaulDebus commented Jul 12, 2018

I have a similar issue when building with the -DBUILD_SHARED_LIBS=ON flag. Linking of the interface visual sfm binary fails.

kravinash commented Sep 4, 2018

I have the same issue. Any one found a solution

rellikb commented Sep 7, 2018

Try updating your CMakeLists.txt to:
find_package(Boost COMPONENTS filesystem system REQUIRED)

BoyuanYan commented Jan 19, 2019 •

in CMakeList.txt, add lines like below (replace <> to your own):

WenyinWei commented Apr 13, 2019

@PaulDebus Yes, Paul is right. The error disappears after unsetting the option.

berniegach commented May 13, 2021

Also had the same problem setting -DBUILD_SHARED_LIBS=ON worked for me.

You can’t perform that action at this time.

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.

Источник

Оцените статью