configure: error: C++ compiler cannot create executables
I am trying to install Robocup simulator from https://sourceforge.net/projects/sserver/?source=typ_redirect . As mentioned in the README file in the folder to build it I have to execute /.configure but I get this error.
Now when I checked my g++ compiler.
But when I tried to install g++ compilier I got this:
Now, what should I do to install the the simulator? Thanks!
4 Answers 4
apt-get can find multiple versions of g++, and even install them side by side. But clearly «g++» on the command line must be a shortcut to only one of them. You can change that shortcut with sudo update-alternatives —config g++ .
First make sure g++ is in your PATH variable. echo $PATH to see if it at least contains /bin:/usr/bin .
Then try to find / -name g++ , if you found it, add the containing folder to PATH.
If that doesn’t help, try reinstall g++ apt-get remove g++; apt-get install g++
Check the compiler version being used in configure command. I checked g++ version by command g++ —version. It was showing 4.9.2. so I specified compiler as g++-4.9.2. but there no alias for command g++-4.9.2. the only compiler was available g++-4.9. so it check for g++ version exact command available by typing manually on command line.
list all gcc installations and links
first try ls /usr/lib/gcc , if which exists, try ln -s /usr/lib/gcc /usr/bin/gcc PATH=$PATH:/usr/lib/gcc and execute ./configure (if it’s installed it will sure work!)
There was a noted issues with different linux distributions, first remove and reinstall g++
search for gcc and add it if not output anything try to add it
if found add it to PATH (either /usr/bin/gcc if the softlink made or /usr/lib/gcc straight away),
if the result is nothing (might take a while) try, (here try to build your own, perhaps that works. Else)
usually, it will be /usr/lib/gcc, if available, make a soft link to the location to /usr/bin/gcc
configure fails with “C compiler cannot create executables”
Right now I’m trying to compile the google protocol buffers from source with MinGW but when I try:
and the config says: This
it seems to fail around this
heres the output of -v:
anyone encountered this or can help with this?
1 Answer 1
There’s something wrong with your MinGW install, or maybe it’s just that your PATH environment variable isn’t set up quite right.
- COLLECT_GCC indicates that gcc is in E:\MinGW\bin\gcc.exe
- COLLECT_GCC_OPTIONS indicates that gcc couldn’t locate cc1.exe , so it’s trying to execute it as a simple cc1 command hoping that the system will find it by a normal PATH search. The system doesn’t find it, so you get the CreateProcess error. Because the Target that GCC is built for is mingw32 , I’d expect that cc1.exe would be located in E:\MinGW\libexec\gcc\mingw32\4.8.1\cc1.exe .
There’s something else interesting about the cc1 invocation: it specifies the option -iprefix E:\MinGWmingw32/4.8.1/ .
I’d expect it to look like: -iprefix E:\MinGW\bin\../lib/gcc/mingw32/4.8.1/
Something is munging the -iprefix option, but I’m not sure what.
I’d suggest reinstalling MinGW. As mentioned in one of my comments, I’d choose one of the following distributions since they’ve always installed in a straightforward manner for me. I can’t say the same thing for the standard MinGW distribution installer, though I hear it’s been greatly improved over the past few years.
nuwen.net’s MinGW Distro — note that recent versions of this are 64-bit native, so it will only run on 64-bit machines and apparently will only build 64-bit binaries (distro versions before 11.0 were 32-bit native and only built 32-bit binaries). One very nice thing about nuwen MinGW is that installation is simply unpacking the archive and setting the path appropriately. There’s a set_distro_paths.bat that will add it to the path for you. Nuwen’s distribution also includes several libraries, including Boost. Unfortunately C++11 threads don’t seem to be supported just yet.
TDM MinGW — you have a choice of 32-bit or 64-bit versions. The 64-bit version will build either 32 or 64-bit targets. The toolchain itself is a 32-bit build, so it doesn’t need a 64-bit machine to perform the compile/link steps. Use the -m32 option to build a 32-bit target. The installer for TDM is a wizard-style installer. C++ 11 threads are supported, but Boost isn’t included.
Check for working C compiler: /usr/bin/cc — broken
I am having a problem with the installation of a ROS packages on my raspberry pi 3. I really hope you can help me.
Processing plain cmake package: ‘fzi_icl_can’ ==> Building with env: ‘/opt/ros/kinetic/env.sh’ ==> cmake /home/pi/ros_catkin_ws/src/fzi_icl_can -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic -DCMAKE_BUILD_TYPE=Release -G Unix Makefiles in ‘/home/pi/ros_catkin_ws/build_isolated/fzi_icl_can/install’
The C compiler identification is unknown
— The CXX compiler identification is GNU 4.9.2
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — broken
CMake Error at /usr/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
** The C compiler «/usr/bin/cc» is not able to compile a simple test program.**
It fails with the following output:
Change Dir: /home/pi/ros_catkin_ws/build_isolated/fzi_icl_can/install/CMakeFiles/CMakeTmp
Run Build Command:»/usr/bin/make» «cmTC_cd4f1/fast»
/usr/bin/make -f CMakeFiles/cmTC_cd4f1.dir/build.make CMakeFiles/cmTC_cd4f1.dir/build
make[1]: Entering directory ‘/home/pi/ros_catkin_ws/build_isolated/fzi_icl_can/install/CMakeFiles/CMakeTmp’
Building C object CMakeFiles/cmTC_cd4f1.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_cd4f1.dir/testCCompiler.c.o -c /home/pi/ros_catkin_ws/build_isolated/fzi_icl_can/install/CMakeFiles/CMakeTmp/testCCompiler.c
cc1: internal compiler error: in next_pass_1, at passes.c:1258
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
CMakeFiles/cmTC_cd4f1.dir/build.make:65: recipe for target ‘CMakeFiles/cmTC_cd4f1.dir/testCCompiler.c.o’ failed
make[1]: *** [CMakeFiles/cmTC_cd4f1.dir/testCCompiler.c.o] Error 1
make[1]: Leaving directory ‘/home/pi/ros_catkin_ws/build_isolated/fzi_icl_can/install/CMakeFiles/CMakeTmp’
Makefile:126: recipe for target ‘cmTC_cd4f1/fast’ failed