Dolphin, the GameCube and Wii emulator - Forums

Full Version: Unable to build from source [linux]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey all, my first post-- please excuse any mistakes.

I'm on OpenSUSE Linux whose repositories do not have a dolphin package, so I have to build from source using cmake and make.
I was able to use cmake and have now gotten the make file. But, make fails to..., well, make.

This is the last step it gets to before aborting:
Code:
[ 60%] Built target audiocommon
[ 60%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/GL/GLInterface/GLInterface.cpp.o
/home/[redacted]/Desktop/DOLPHIN/dolphin-emu/Source/Core/Common/GL/GLInterface/GLInterface.cpp: In function ‘std::unique_ptr<cInterfaceBase> HostGL_CreateGLInterface()’:
/home/[redacted]/Desktop/DOLPHIN/dolphin-emu/Source/Core/Common/GL/GLInterface/GLInterface.cpp:39:10: error: ‘make_unique’ is not a member of ‘std’
  return std::make_unique<cInterfaceGLX>();
         ^
/home/[redacted]/Desktop/DOLPHIN/dolphin-emu/Source/Core/Common/GL/GLInterface/GLInterface.cpp:39:40: error: expected primary-expression before ‘>’ token
  return std::make_unique<cInterfaceGLX>();
                                       ^
/home/[redacted]/Desktop/DOLPHIN/dolphin-emu/Source/Core/Common/GL/GLInterface/GLInterface.cpp:39:42: error: expected primary-expression before ‘)’ token
  return std::make_unique<cInterfaceGLX>();
                                         ^
/home/[redacted]/Desktop/DOLPHIN/dolphin-emu/Source/Core/Common/GL/GLInterface/GLInterface.cpp:46:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Source/Core/Common/CMakeFiles/common.dir/build.make:1088: recipe for target 'Source/Core/Common/CMakeFiles/common.dir/GL/GLInterface/GLInterface.cpp.o' failed
make[2]: *** [Source/Core/Common/CMakeFiles/common.dir/GL/GLInterface/GLInterface.cpp.o] Error 1
CMakeFiles/Makefile2:1088: recipe for target 'Source/Core/Common/CMakeFiles/common.dir/all' failed
make[1]: *** [Source/Core/Common/CMakeFiles/common.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2


So, from my understanding, all the errors stem from the compiler not understanding what make_unique is supposed to be. I found that it's a newer (c++14?) feature. But, no matter what I do: adding compiler flags to the Makefile instructions for "common" to set the standard to c++14, c++11, "c++0x", or setting the compiler to specifically use gcc-5 instead of gcc, a combination of two, and invoking all this on the command line, it makes no difference.

Any help would be appreciated!

Thanks.
Try appending "-std=c++14" (without ") to CMAKE_CXX_FLAGS in the CMakeCache.txt files instead in the makefiles directly.

(I can't find any mention of CXX_STANDARD or CMAKE_CXX_STANDARD that should set those flags.. I'll look if I do an PR about it)
(10-17-2017, 12:52 AM)Neui Wrote: [ -> ]Try appending "-std=c++14" (without ") to CMAKE_CXX_FLAGS in the CMakeCache.txt files instead in the makefiles directly.

(I can't find any mention of CXX_STANDARD or CMAKE_CXX_STANDARD that should set those flags.. I'll look if I do an PR about it)

Hey, thanks for the response. For whatever reason it's saying it's an invalid option. This doesn't happen when I tell it to use c++11, so my guess is it might be a gcc issue. Must I explicitly tell it to use gcc-5 and not just gcc? Where would I do this if it's the case?
Sounds a little like your GCC/G++ packages are really outdated. And yes, you should potentially tell it to use gcc-5 instead (which is the minimum we require)
(10-17-2017, 01:42 AM)Jack Frost Wrote: [ -> ]Sounds a little like your GCC/G++ packages are really outdated. And yes, you should potentially tell it to use gcc-5 instead (which is the minimum we require)

Thanks to you as well. My distro came with 4.8.1. I did install gcc-5 but they are currently happily co existing on my computer. How do I instruct make to use gcc-5?
In the very same CMakeCache.txt file, change the value of CMAKE_CXX_COMPILER to g++-5 and CMAKE_C_COMPILER to gcc-5.
You should just use -D or set CC/CXX instead: https://cmake.org/Wiki/CMake_FAQ#How_do_...ompiler.3F
(10-17-2017, 01:42 AM)Jack Frost Wrote: [ -> ]Sounds a little like your GCC/G++ packages are really outdated. And yes, you should potentially tell it to use gcc-5 instead (which is the minimum we require)

(10-17-2017, 01:54 AM)Neui Wrote: [ -> ]In the very same CMakeCache.txt file, change the value of CMAKE_CXX_COMPILER to g++-5 and CMAKE_C_COMPILER to gcc-5.

Awesome! Thanks, this worked and I have successfully built the program however I'm now bugged by a seemingly related issue when i try to run it:
Code:
Fatal Error: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1002,STL containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1009,STL containers,compatible with 2.8).
Aborted (core dumped)

Thoughts??

Thanks for your time thus far: Greatly appreciated.

Upon further research it seems this is wxWidgets fault. Can I give it instructions to set the version in the Makefile or one of the other files?
(10-17-2017, 02:33 AM)LeGoat Wrote: [ -> ]Awesome! Thanks, this worked and I have successfully built the program however I'm now bugged by a seemingly related issue when i try to run it:

Code:
Fatal Error: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1002,STL containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1009,STL containers,compatible with 2.8).
Aborted (core dumped)

Thoughts??

Thanks for your time thus far: Greatly appreciated.

Upon further research it seems this is wxWidgets fault. Can I give it instructions to set the version in the Makefile or one of the other files?

For c++11 (and beyond) GCC had to change the interface ("ABI") it uses for c++, so I assume that the wxwidgets library on your system was build by the system version of 4.8, which was before that change.

It effectively means that *all* C++ libraries and objects must be build using the same abi - so either you need to rebuild versions of all the dependencies that use c++ with gcc-5 and use those, or update your distro so it was build by a newer compiler in the first place.
(10-17-2017, 02:32 PM)JonnyH Wrote: [ -> ]For c++11 (and beyond) GCC had to change the interface ("ABI") it uses for c++, so I assume that the wxwidgets library on your system was build by the system version of 4.8, which was before that change.

It effectively means that *all* C++ libraries and objects must be build using the same abi - so either you need to rebuild versions of all the dependencies that use c++ with gcc-5 and use those, or update your distro so it was build by a newer compiler in the first place.

Thanks for the response. 
My distro has had only one update since I installed it and from what I can tell it ships with the same version of gcc, but I will try upgrading it. 
When I installed gcc-5, the package description said it included the gcc-5 versions of all the libraries, so shouldn't it be using them by default when I tell it to make using gcc-5? Is there a way I can do so if it is not the case? Or, shall I have to rebuild all the libraries?
As a side note, I tried installing wxWidgets again from the Zypper/YaST repo. Did not help. 
Pages: 1 2