0

I am trying to compile a code involving python and C++ in Ubuntu 12.04.5 LTS and I have this type of error

hammouc@kw13921:~/Documents/mimclib$ make
python setup.py clean
running clean
removing 'build/temp.linux-x86_64-2.7' (and everything under it)
removing 'build'
rm -f -r build dist mimclib.egg-info
rm -f -r /home/hammouc/.local/lib/python2.7/site-packages/mimclib*
python setup.py build_ext --inplace
running build_ext
building 'mimclib.libset_util' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/mimclib
creating build/temp.linux-x86_64-2.7/mimclib/libsetutil
creating build/temp.linux-x86_64-2.7/mimclib/libsetutil/src
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I -I/usr/include/python2.7 -c mimclib/libsetutil/src/set_util.cpp -o build/temp.linux-x86_64-2.7/mimclib/libsetutil/src/set_util.o -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: error: unrecognized command line option ‘-std=c++11’
error: command 'gcc' failed with exit status 1
make: *** [inplace] Error 1

Could anyone help since I am not so familiar with ubuntu. Thanks.

P.-H. Lin
  • 2,824

2 Answers2

2

You can upgrade your compiler, or just modify the setup.py file.

Find the following line:

extra_compile_args=['-std=c++11'])],

And change the flag into -std=c++0x, which makes it:

extra_compile_args=['-std=c++0x'])],

And run it again, it should work with this. (Tested with the mimclib source code on github)

P.-H. Lin
  • 2,824
1

You need at least gcc 4.8 to compile this. See How to install gcc-4.8 for how you can install it on Ubuntu 12.04.