Build error on Fedora 24

4 replies [Last post]
DjCrush
User offline. Last seen 7 years 24 weeks ago. Offline
Joined: 2016-07-20
Posts: 4

I was able to install all of the necessary dependencies after some struggling with dnf however at 90% of make command i'm getting the following error, please help!

[ 90%] Linking CXX executable ../bin/hedgewars
/usr/bin/ld: CMakeFiles/hedgewars.dir/drawmapscene.cpp.o: undefined reference to symbol 'cos@@GLIBC_2.2.5'
/usr/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
QTfrontend/CMakeFiles/hedgewars.dir/build.make:5587: recipe for target 'bin/hedgewars' failed
make[2]: *** [bin/hedgewars] Error 1
CMakeFiles/Makefile2:372: recipe for target 'QTfrontend/CMakeFiles/hedgewars.dir/all' failed
make[1]: *** [QTfrontend/CMakeFiles/hedgewars.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
[aackerm4@fedora-laptop hedgewars]$

nemo
nemo's picture
User offline. Last seen 19 weeks 5 days ago. Offline
Joined: 2009-01-28
Posts: 1861

Link errors usually mean some inconsistency in your local build configuration since it successfully included headers for the build, presumably.
cos makes me think a missing -lm which I've definitely forgotten before on small projects.
That fact that you're hitting it suggests some problem with our build system on fedora though.
Not sure what, since fedora packagers seem to be managing ok.

You could maybe try explicitly adding -lm to your ld flags env var, and purging cmake cache and rerunning.

Or maybe looking to see what the fedora packagers are doing.

Hm. What version of Fedora is this anyway? That glibc version is surprising. Is it possible you have some package inconsistencies?

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

DjCrush
User offline. Last seen 7 years 24 weeks ago. Offline
Joined: 2016-07-20
Posts: 4

Thanks for the info. I tried again, maybe I'm doing it wrong. I ran cmake -DCMAKE_CXX_COMPILER=/usr/bin/gcc -DCMAKE_CXX_FLAGS="-lz" LDFLAGS="-lm" . then make and received same error.

Some info about my system, vanilla fedora 24.
Linux fedora-laptop 4.6.3-300.fc24.x86_64 #1 SMP Fri Jun 24 20:52:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

DjCrush
User offline. Last seen 7 years 24 weeks ago. Offline
Joined: 2016-07-20
Posts: 4

Ok, so this time I tried:

make clean

cmake .

make

Got a different error:

[ 90%] Linking CXX executable ../bin/hedgewars
/usr/bin/ld: CMakeFiles/hedgewars.dir/team.cpp.o: undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'
/usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
QTfrontend/CMakeFiles/hedgewars.dir/build.make:5587: recipe for target 'bin/hedgewars' failed
make[2]: *** [bin/hedgewars] Error 1
CMakeFiles/Makefile2:372: recipe for target 'QTfrontend/CMakeFiles/hedgewars.dir/all' failed
make[1]: *** [QTfrontend/CMakeFiles/hedgewars.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

DjCrush
User offline. Last seen 7 years 24 weeks ago. Offline
Joined: 2016-07-20
Posts: 4

YAY! got a successful make after using this:

cmake -DCMAKE_CXX_FLAGS="-lstdc++ -lm" .
make

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]