Page 1 of 1

DSO missing from command line

Posted: Sun Jul 23, 2017 11:34 am
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?

Re: DSO missing from command line

Posted: Sun Jul 23, 2017 4:53 pm
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.

Re: DSO missing from command line

Posted: Sun Jul 23, 2017 10:40 pm
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.

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 2:13 am
by Dilvish
were you rebuilding in your old build directory? Perhaps make clean, then delete CMakeCache.txt and rerun cmake and then make

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 4:13 am
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.

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 11:54 am
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

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 12:57 pm
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

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 2:53 pm
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?

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 3:20 pm
by Scara
I'm using git shell commands

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 4:01 pm
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.

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 5:05 pm
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.

Re: DSO missing from command line

Posted: Mon Jul 24, 2017 8:37 pm
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

Re: DSO missing from command line

Posted: Tue Jul 25, 2017 12:33 am
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)

Re: DSO missing from command line

Posted: Thu Nov 09, 2017 7:17 pm
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.