DSO missing from command line

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

DSO missing from command line

#1 Post by Scara »

Hi there!

I did a major hardware update and just tried compiling (4fff4c1) on my new Ryzen 1600, Mint 18.2 KDE.
Working fine with -j3, but failed going:

Code: Select all

/usr/bin/ld: CMakeFiles/freeorionca.dir/AI/AIInterface.cpp.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc@@GLIBCXX_3.4.21'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/freeorionca.dir/build.make:475: recipe for target 'freeorionca' failed
make[2]: *** [freeorionca] Error 1
CMakeFiles/Makefile2:217: recipe for target 'CMakeFiles/freeorionca.dir/all' failed
and

Code: Select all

/usr/bin/ld: CMakeFiles/freeoriond.dir/universe/UniverseGenerator.cpp.o: undefined reference to symbol 'sqrt@@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
CMakeFiles/freeoriond.dir/build.make:475: recipe for target 'freeoriond' failed
make[2]: *** [freeoriond] Error 1
CMakeFiles/Makefile2:142: recipe for target 'CMakeFiles/freeoriond.dir/all' failed
make[1]: *** [CMakeFiles/freeoriond.dir/all] Error 2
Can anybody help me solving this?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: DSO missing from command line

#2 Post by Dilvish »

Looks to me like Geoff may have fixed the sqrt reference in the commit just after the one you tried compiling. Though I can't say for sure since the commit you had trouble with still just compiled fine for me on Linux (Ubuntu). Just to be sure, have you done a make clean and tried recompiling?

If you look at the commit log for AIInterface.h and AIInterface.cpp there are not a large number of commits in the past 6 months, you could try honing in on which one causes the trouble for you.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

Re: DSO missing from command line

#3 Post by Scara »

Hi,
I tried the latest commit, nothing changed. I guess by what you said that the problem is located in the system update and I might be missing some program that isn't mentioned by cmake.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: DSO missing from command line

#4 Post by Dilvish »

were you rebuilding in your old build directory? Perhaps make clean, then delete CMakeCache.txt and rerun cmake and then make
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

LGM-Doyle
Programmer
Posts: 219
Joined: Mon Feb 29, 2016 8:37 pm

Re: DSO missing from command line

#5 Post by LGM-Doyle »

Congratulations on the new machine.

Did you upgrade both the hardware and the software?

As Dilvish asked, is there an older version that compiles successfully on your new hardware?

It would be helpful, if you posted the entire compile log.

Code: Select all

/usr/bin/ld: CMakeFiles/freeorionca.dir/AI/AIInterface.cpp.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc@@GLIBCXX_3.4.21'
, implies that you are linking with the wrong/non-existent stdlib. C++11 changed the ABI of the stdlib.

Have you made sure that your stdlib is present and C++11 compatible?

I would make a test program that uses at least one C++11 feature and std::string in order to be certain.

Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

Re: DSO missing from command line

#6 Post by Scara »

Hey,
Dilvish wrote:were you rebuilding in your old build directory? Perhaps make clean, then delete CMakeCache.txt and rerun cmake and then make
I had a clean install of Linux Mint - KDE - 18.2 on the new system. I tried what you said but it didn't help. I must admit I'm not sure how to clone a older git version, for example from two weeks ago. I usually clone at the beginning and then make pulls to update.
LGM-Doyle wrote:It would be helpful, if you posted the entire compile log.
I had a look into the CMakeError file and it says there CMAKE_CXX_COMPILER-NOTFOUND. I checked the path /usr/bin/gcc theres a link to gcc-5 in the same directory. You probably see deeper, so I attached the two logs I found.
LGM-Doyle wrote: implies that you are linking with the wrong/non-existent stdlib. C++11 changed the ABI of the stdlib.
Don't exactly understand sorry, but there seems something missing as mentioned above. I have libstdc++6,libstdc++-5-dev,libstdc++-4.8-dev and g++-5 as compiler installed
Attachments
CMakeOutput.log
(43.4 KiB) Downloaded 323 times
CMakeError.log
(7.97 KiB) Downloaded 320 times

Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

Re: DSO missing from command line

#7 Post by Scara »

LGM-Doyle wrote:Congratulations on the new machine.
Hehe, thanks! I'm very pleased the speed already so I can't wait to give freeorion a try, that's a core for each AI :D

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: DSO missing from command line

#8 Post by Vezzra »

Scara wrote:I must admit I'm not sure how to clone a older git version, for example from two weeks ago.
What git client do you use? Some third party graphical UI tool (like SmartGit, SourceTree, etc.)? Or the git shell commands?

Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

Re: DSO missing from command line

#9 Post by Scara »

I'm using git shell commands

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: DSO missing from command line

#10 Post by Vezzra »

In this case do a "git checkout <commit sha hash>" to checkout a specific commit. You don't need to type the entire SHA1 hash, an abbreviated one is sufficient (as long as it's not ambigous). This will leave you with a "detached head" (that is a head detached from any branch), so you should do no actual work in your working copy while in this state, but this way you can switch to any commit you want.

Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

Re: DSO missing from command line

#11 Post by Scara »

Hmmm, interesting, I made a checkout with 2017-07-03.a5f0edc, a build I know that worked cause it was involved with my last playfeedback post, is indeed compiling now without complains.
Attachments
CMakeOutput.log
(43.63 KiB) Downloaded 310 times
CMakeError.log
(5.41 KiB) Downloaded 301 times

LGM-Doyle
Programmer
Posts: 219
Joined: Mon Feb 29, 2016 8:37 pm

Re: DSO missing from command line

#12 Post by LGM-Doyle »

That's great.

If you could do a bisection and determine which is the first commit that is broken, that might make it obvious how to fix the problem.

You can use git to help with the bisection. Start the bisection by typing:

Code: Select all

git bisect start

git bisect good <hash of good  commit>

git bisect bad <hash of bad commit>
Then git will checkout a commit in between <good hash> and <bad hash>, near the middle. Try to compile it and then type either

Code: Select all

git bisect good 
or

Code: Select all

git bisect bad
and git will checkout another commit closer to the commit you are looking for.

When you are done reset git to the commit that you started from by typing:

Code: Select all

git reset

Scara
Space Kraken
Posts: 142
Joined: Thu Apr 23, 2015 11:21 am

Re: DSO missing from command line

#13 Post by Scara »

Now this is very confusing. I tried to bisect the commits, but they all worked, even the one I started this posting with. Then I pulled git to the newest version and that worked as well, but only in my extra checkout directory. In my main game dict, the same version won't work with the same message as usual. Here are the differences:

Freeorion dict
git clone 4fff4c1
pulls from there on
update 3de874e
all don't work

Checkout dict
git clone ? from yesterday
git checkout a5f0edc (worked)
git bisects with 4fff4c1
all work
another pull to update 3de874e (works)
Attachments
CMakeOutput.log
checkout
(65.14 KiB) Downloaded 312 times
CMakeError.log
checkout
(37.88 KiB) Downloaded 289 times
CMakeOutput.log
main game
(5.25 KiB) Downloaded 314 times
CMakeError.log
main game
(37.88 KiB) Downloaded 327 times

spikethehobbit
Space Squid
Posts: 66
Joined: Mon Aug 27, 2012 7:24 pm

Re: DSO missing from command line

#14 Post by spikethehobbit »

The problem is that you have a stale build directory. One of the .o or .so files was linked against an old system library and isn't getting rebuilt. You need to run ccmake again and recreate your config files.
All contributions are submitted under GPL or LGPL v2 or later, or under appropriate Creative Commons licence, consistent with project guidlines.

Post Reply