make fail @ linking Cxx executable CustomWidget
MikePerreman opened this issue · 6 comments
Hello, I followed this tutorial for building SFML on ubuntu (as apt-get libsfml-dev is out of date), While running make, it errors at Linking CXX executable CustomWidget.
Full error:
/Desktop/SFGUI-0.3.2/build$ sudo make install
...
[ 63%] Built target sfgui
[ 63%] Linking CXX executable CustomWidget
/usr/bin/ld: CustomWidget: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-linux-gnu/5/libgcc.a(cpuinfo.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
examples/CMakeFiles/CustomWidget.dir/build.make:103: recipe for target 'examples/CustomWidget' failed
make[2]: *** [examples/CustomWidget] Error 1
CMakeFiles/Makefile2:168: recipe for target 'examples/CMakeFiles/CustomWidget.dir/all' failed
make[1]: *** [examples/CMakeFiles/CustomWidget.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
What am I doing wrong? I followed the build instructions Here
Is there, by chance, a prebuilt for ubuntu that I didnt see on the release page?
Using the magic of Google, would've brought you to multiple threads on the SFML forum telling you that it is a bug in GCC. At best you update GCC or your distro if GCC is outdated for your distro. 😉
hmm, I have gcc7 installed, and Im still get this error. Turning off examples allows me to install the sfgui.
I assume theres no problems running without the examples, although, it would be nice do figure this out.
If you have gcc7 installed, make sure you're actually using gcc7 and its libraries. From the error you can see that this is not the case.
/usr/lib/gcc/x86_64-linux-gnu/5/libgcc.a
hmm, Ive ran it again, after a reboot and actually linking to gcc7, and it is definitely using gcc7, but stil I get the same error, this time with /usr/bin/ld: CustomWidget: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a(cpuinfo.o) is referenced by DSO
instead of
/usr/bin/ld: CustomWidget: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-linux-gnu/5/libgcc.a(cpuinfo.o) is referenced by DSO
Tried with gcc 6, and same error:
/usr/bin/ld: CustomWidget: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-linux-gnu/6/libgcc.a(cpuinfo.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
examples/CMakeFiles/CustomWidget.dir/build.make:103: recipe for target 'examples/CustomWidget' failed
make[2]: *** [examples/CustomWidget] Error 1
CMakeFiles/Makefile2:168: recipe for target 'examples/CMakeFiles/CustomWidget.dir/all' failed
make[1]: *** [examples/CMakeFiles/CustomWidget.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Aww, shit, It was an issue with SFML, rebuilding SFML fixed this issue. I can now make and make install just fine.