Open vanchung1995 opened 4 years ago
you solved this problem?
I was facing the same problem. I didn't want to uninstall gcc because other projects might need it.
Solution: Install gcc-5 (technically it should work on gcc-6 also but I didn't try). So install gcc-5.
sudo apt install g++-5
sudo apt install gcc-5
Do not update the alternatives. Let gcc-5 live peacefully with the current gcc version.
Then instead of cmake ..
do this cmake -D CMAKE_C_COMPILER:string=gcc-5 -D CMAKE_CXX_COMPILER=g++-5 ../
Simple
It worked for me.
UPDATE: when the following error came
Need to add -std=c++11 to CMAKE_CXX_FLAGS
I just replaced all the std=c++14
in CMakeLists.txt
file with std=c++11
I solve the issue by defining a previous version of gcc, like this: cmake .. -DCMAKE_C_COMPILER=gcc-7
I ran these commands and it raised this error: