Emulator Issues #8636
closed#error <regex> is broken in GCC < 4.9; please upgrade
0%
Description
What's the problem? Describe what went wrong in few words.
What did you expect to happen instead?
Compiling 4.0-6592 from source broke...
What steps will reproduce the problem?
[Don't assume we have ever played the game and know any level names. Be as
specific as possible.]
- Tried to compiled 4.0-6592 from source but fails.
Does using an older version of Dolphin solve your issue? If yes, which
versions of Dolphin used to work?
The last version I compiled works fine; 4.0.6337
Slackware 14.1 x86_64
gcc 4.8.2
Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
[Upload big files to a hosting service and post links here!]
Here is the output from the terminal;
Scanning dependencies of target common
[ 54%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/BreakPoints.cpp.o
[ 54%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/CDUtils.cpp.o
[ 54%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/ColorUtil.cpp.o
[ 54%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/ENetUtil.cpp.o
[ 54%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/FileSearch.cpp.o
/tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:6:2: error: #error <regex> is broken in GCC < 4.9; please upgrade
#error <regex> is broken in GCC < 4.9; please upgrade
^
/tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp: In function 'std::vector<std::basic_string<char> > DoFileSearch(const std::vector<std::basic_string<char> >&, const std::vector<std::basic_string<char> >&, bool)':
/tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:47:83: error: no matching function for call to 'regex_replace(const std::basic_string<char>&, std::regex, const char [3])'
regex_str += std::regex_replace(std::regex_replace(str, std::regex("\."), "\."), std::regex("\"), ".");
^
/tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:47:83: note: candidates are:
In file included from /usr/include/c++/4.8.2/regex:62:0,
from /tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:11:
/usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template<class _Out_iter, class _Bi_iter, class _Rx_traits, class _Ch_type> _Out_iter std::regex_replace(_Out_iter, _Bi_iter, _Bi_iter, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type)
regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
^
/usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template argument deduction/substitution failed:
/tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:47:83: note: deduced conflicting types for parameter '_Bi_iter' ('std::basic_regex<char>' and 'const char*')
regex_str += std::regex_replace(std::regex_replace(str, std::regex("\."), "\."), std::regex("\"), ".");
^
In file included from /usr/include/c++/4.8.2/regex:62:0,
from /tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:11:
/usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template<class _Rx_traits, class _Ch_type> std::basic_string<_Ch_type> std::regex_replace(const std::basic_string<_Ch_type>&, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type)
regex_replace(const basic_string<_Ch_type>& __s,
^
/usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template argument deduction/substitution failed:
/tmp/sar/dolphin-4.0.6592/Source/Core/Common/FileSearch.cpp:47:83: note: mismatched types 'const std::basic_string<_Ch_type>' and 'const char [3]'
regex_str += std::regex_replace(std::regex_replace(str, std::regex("\."), "\."), std::regex("\"), ".");
^
make[2]: *** [Source/Core/Common/CMakeFiles/common.dir/FileSearch.cpp.o] Error 1
make[1]: *** [Source/Core/Common/CMakeFiles/common.dir/all] Error 2
make: *** [all] Error 2
PLEASE tell me I don't need GCC 4.9 now to compile dolphin?
Updated by JMC4789 over 9 years ago
It was an unforeseen consequence of regex being broken in GCC 4.8; so yes, a version of GCC that has working regex is required.
Updated by shayolden over 9 years ago
I too had this problem when attempting to compile on Linux Mint 17.1 64-bit. Installed gcc 4.9 and compiled okay.
Updated by guywithasword over 9 years ago
I installed the GCC 4.9 PPA specifically referenced on the wiki (ppa:dolphin-emu/gcc-for-dolphin) but still get the same error anyway on Mint 17.1 x64. What am I missing?
Updated by ears.box over 9 years ago
When you build dolphin either in a build script or at the command line, you need to export these two paths for 4.9x
export CC=/path/to/bin/gcc
export CXX=/path/to/bin/g++
Then when you run dolphin you need to also export to the correct library path, as example below, I compiled gcc 4.9.2 and placed it in /usr/local;
export LD_LIBRARY_PATH="/usr/local/lib64"
Updated by JosJuice about 9 years ago
- Status changed from Won't fix to Fixed
Dolphin's regex code was reverted in 4.0-7876, so GCC 4.8 should be able to compile Dolphin again now.