LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   configure: error: C++ compiler cannot create executables (https://www.linuxquestions.org/questions/linux-newbie-8/configure-error-c-compiler-cannot-create-executables-354485/)

dicou 08-18-2005 04:37 AM

configure: error: C++ compiler cannot create executables
 
i tried to compile aMule with my debian, but i get this problem,
i'm a noob and i just install my debian so there is not a lot of stuffs on it so maybe i need something else, but i dont know what :)

Thks for help.


Code:

dicou@debian:~/tmp/aMule-2.0.3$ ./configure
checking build system type... i686-pc-linuxlibc1
checking host system type... i686-pc-linuxlibc1
checking target system type... i686-pc-linuxlibc1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for C++ compiler default output file name... configure: error: C++ comp
iler cannot create executables
See `config.log' for more details.


Nylex 08-18-2005 04:40 AM

You don't have a C++ compiler on there. You need to install the gcc-c++ package (while you're at it, install gcc as well if you haven't already). This can probably be done with apt-get, but I'm not sure how you use it.

mirex 05-04-2007 07:23 PM

Compiler can be present.

this can be caused by many problems, as this error is probably meaning that output executable target file cannot be created for some reason.

In my case right now it was caused by wrong compiler parameter.
I use KDevelop for unix (c++ dev tool).

After output "see config.log" I went to look at it; I missed the correct one, as there was one in project directory, which is not the correct one; correct one for me was in /debug/ subdirectory, because I was building Debug target.

inside I searched for the error message, "cannot create executables" and I saw that I was compiling my program with command:
gcc -o target _UNIX -D _UNIX ... something more

problem in my case was the first "_UNIX", which is invalid parameter for compiler. I realized that I have entered it incorrectly into Linker flags in KDevelopment project options. After I removed it everything compiled allright. (second, -D _UNIX is correct, as it specifies something like #define _UNIX for compiler)

So I suggest to see the config.log for your project and find the problem inside it. It can take some time.

reverse 05-05-2007 12:08 AM

mirex, if you look at the output of the configure script:

Quote:

checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no

Nylex 05-05-2007 01:47 AM

Why on Earth did you drag up such an old thread?

mirex 05-07-2007 01:19 AM

Hi
sorry for gravedigging, but this was first hit on google when I was looking for "compiler cannot create executables" problem. So I thought that it could help also others, who are looking for solution to this problem.

lazyron 08-26-2007 06:32 PM

Thanks Mirex
 
I was getting the same "cannot create executables" error while configuring Sopcast for Ubuntu 7.04.

Is it still the first hit off Google for this error message. :)

In my case I was missing the g++ compiler, and yes, checking config.log is helpful, even if it's not the friendliest thing in the world to read.

AlucardZero 08-26-2007 08:29 PM

If you're on Ubuntu or Debian as the OP is, install the build-essential package, either through Synaptic or with apt-get install build-essential.

nmansour 06-26-2008 07:52 PM

Thanks, that was very helpful
 
Hi,

that was very helpful, and I am not sorry for digging it out again, as it is, still, the first hit on Google!

Noha

inoitna 07-10-2008 04:14 AM

Code:

configure: error: GNU gettext tools not found; required for intltool
i have encountered the same problems as the title stated, and the problem was solved...

But the new problem is occur now...
Can anyone tell me what should i do for next??
Thanks

Celestipoo 12-22-2008 04:32 PM

You can install gettext with the package manager or from the command line:
Quote:

sudo apt-get install gettext

sanemanmad 05-01-2009 11:33 AM

Hi,

Thanks for the help...
Code:

apt-get build-essential
solved this issue for me.

Code:

configure: error: C compiler cannot create executables
See `config.log' for more details.


Fedora 6 03-17-2011 07:16 AM

Solved for me
 
Dear all
Maybe it is too late but i faced this problem today and i solved it by installing g++
sudo apt-get install g++

hope this help any one

Bye

AlucardZero 03-17-2011 08:05 AM

Yep, g++ is one of the things that installing build-essential will install.

Boeta87 08-10-2011 07:33 AM

getting the compiler in CentOS
 
Hi, thought id share this, as the commands is for Debian, here's the CentOS command to get the compilers:

yum install gcc gcc-c++ kernel-devel

Thanks for the help!!!

sanpat 12-22-2012 01:00 PM

ERROR compiling livestatus! checking whether the C++ compiler works... no
 
Error : C++ compiler

checking whether make sets $(MAKE)... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether the C++ compiler works... no
configure: error: in `/tmp/check_mk-1.2.0p3/livestatus.src':
configure: error: C++ compiler cannot create executables
See `config.log' for more details




Solution

[root@skyon check_mk-1.2.0p3]# yum install gcc gcc-c++ kernel-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Package gcc-4.1.2-48.el5.i386 already installed and latest version
Package kernel-devel-2.6.18-194.el5.i686 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.i386 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++-devel = 4.1.2-48.el5 for package: gcc-c++
--> Running transaction check
---> Package libstdc++-devel.i386 0:4.1.2-48.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================== ====================================================================
Package Arch Version Repository Size
==================================================================================================== ====================================================================
Installing:
gcc-c++ i386 4.1.2-48.el5 base 3.4 M
Installing for dependencies:
libstdc++-devel i386 4.1.2-48.el5 base 2.8 M

Transaction Summary
==================================================================================================== ====================================================================
Install 2 Package(s)
Upgrade 0 Package(s)

Install successfully
Installation completed successfully.
Please restart Nagios and Apache in order to update/active check_mk's web pages.

Thanks

fupa 06-21-2017 02:34 PM

I'm hitting the same error "C++ compiler cannot create executables"
The difference here is I'm using Cygwin on Windows to configure a tarball. G++ is installed.
See below image:
http://imgur.com/a/I3hwg

AlucardZero 06-22-2017 02:18 PM

Check config.log for details

fupa 06-22-2017 03:47 PM

Ya the config.log was pretty useless. Turns on this post on SO had the answer https://stackoverflow.com/questions/...-cygwin-minigw

Laserbeak 06-22-2017 04:17 PM

You probably had some dummy shell named c++ somewhere, but it wasn't a real C++ compiler.


All times are GMT -5. The time now is 06:44 PM.