LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-26-2004, 06:31 AM   #1
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Rep: Reputation: 0
Unhappy C++ compiler cannot create executables


Hello everybody
I've got a problem with compiling applications from sources. Whenever I try to run ./configure on diffrent sources (I tried to compile ettercap, geoIP, aMule etc.), an error message shows:
Quote:
checking for C compiler default output file name... configure: error: C compiler cannot create executables
.

Config.log says:
Quote:
(...) configure:963: checking for gcc
configure:1076: checking whether the C compiler (gcc -march=athlon-tbird -mcpu=athlon-tbird -Os -s -pipe -fomit-frame-pointer -DNDEBUG -DG_DISABLE_ASSERT /usr/local/lib) works
configure:1092: gcc -o conftest -march=athlon-tbird -mcpu=athlon-tbird -Os -s -pipe -fomit-frame-pointer -DNDEBUG -DG_DISABLE_ASSERT /usr/local/lib conftest.c 1>&5
/usr/local/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status
configure: failed program was:

#line 1087 "configure"
#include "confdefs.h"
What's the problem? A few days before I was able to compile applications - everything was allright. But then I started to update my MandrakeLinux 10 (by Mandrake update program) and - as you see - gcc crashed... (But I don't remember if gcc was updated - I selected all available updates and installed them)
My gcc version is gcc (GCC) 3.3.2 (Mandrakelinux 10.0 3.3.2-7mdk).
 
Old 08-26-2004, 07:15 AM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
hi
is ur GCC correctly installed
try running a simple program on C with gcc

regards
 
Old 08-26-2004, 04:54 PM   #3
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
I compiled simple 'hello world':
Code:
#include <iostream.h>
using namespace std;

int main( void )
{
  cout << "Hello World!" << endl;
  return 0;
}
by running command
g++ -o simple simple.gcc
and I didn't have any problems...
 
Old 08-26-2004, 05:00 PM   #4
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
hi
okay u compiled it but did u run it because the error u are geting tells u that it is unable to create executables

also try a C program with gcc ,

regards
 
Old 08-27-2004, 12:14 AM   #5
mrosin
LQ Newbie
 
Registered: Aug 2004
Location: Tokyo
Distribution: rh9
Posts: 1

Rep: Reputation: 0
Solved similar problem

Hi,

I found your post when searching google unsuccessfully for an answer when I got the same error.

It seems likely to me that you have the same cause since I have never seen that error before.

I had the same exact problem when trying to build a program a few days ago. The source was located on an external IDE USB drive (ext3 partition) I had mounted as /dev/sda1 and then cd'd into the source directory.

The problem disappeared when I moved the source directory off the external drive and onto my main hard disk (into /usr/local). It immediately built with no problem.

Now I seem to remember somewhere about a setting (possibly a switch for the mount command?) that would not let you execute binaries on the IDE drive. Since I only use it for mass storage normally I never came upon the problem until now.

So, the problem is likely execute permissions on your media.. try to move the source folder to your internal hard disk if it is not there, and check permissions on it. Were you building on an externally mounted drive?

Another possibility I just again when looking at Google, soeone with this problem on Max OSX had to redownload and reinstall gcc. With Apple they needed the Developer Tools cd also reinstalled. For your installation it might mean you are missing developer tools rpms or have messed it up somehow. If you don't build much or messed around recently with your system badly this could be it, but first try the idea above please.

Last edited by mrosin; 08-27-2004 at 12:24 AM.
 
Old 08-27-2004, 03:23 AM   #6
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
masand: Yes, I ran it and everything was ok. I don't know C language, could you write me something? I would try to compile it.

mrosin: I store my source files on main hard disk, on the partition where linux is installed (ext3)... I'm not able to move it to an another media, becouse I haven't got any
In the answer of the second part of your post - I only ran Mandrake update and I didn't make any other changes in my system... Before it everything was allright - I had been able to compile sources and I had had compiled many applications....
 
Old 08-27-2004, 03:50 AM   #7
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
But take look at this:

Quote:
gcc -o conftest -march=athlon-tbird -mcpu=athlon-tbird -Os -s -pipe -fomit-frame-pointer -DNDEBUG -DG_DISABLE_ASSERT /usr/local/lib conftest.c>&5
/usr/local/lib: file not recognized: Is a directory
-the path to file given to gcc is '/usr/local/lib conftest.c' - shouldn't it be 'usr/local/lib/conftest.c' ??
 
Old 08-27-2004, 03:53 AM   #8
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
But take look at this (from config.log):

Quote:
gcc -o conftest -march=athlon-tbird -mcpu=athlon-tbird -Os -s -pipe -fomit-frame-pointer -DNDEBUG -DG_DISABLE_ASSERT /usr/local/lib conftest.c >&5
/usr/local/lib: file not recognized: Is a directory
-the file path given to gcc is '/usr/local/lib conftest.c' - shouldn't it be 'usr/local/lib/conftest.c' (without a blank space between '/usr/local/lib' and 'conftest.c')??


edited: SORRY for the double post! read the last one

Last edited by eomerek; 08-27-2004 at 03:54 AM.
 
Old 08-27-2004, 04:06 AM   #9
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
hi there
here is the C program
-------------------------------------------------------------------------------
#include<stdio.h>
void main()
{
printf("the C program is working");
}
----------------------------------------------------------------------

copt this to test.c
#gcc -otest test.c
#./test

try this

regards
gaurav
 
Old 08-27-2004, 06:18 AM   #10
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
gcc compiles, ./test works... - everything is ok....
 
Old 08-28-2004, 08:14 AM   #11
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
anyone...?
 
Old 08-28-2004, 08:21 AM   #12
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
Quote:
Originally posted by eomerek
But take look at this (from config.log):


-the file path given to gcc is '/usr/local/lib conftest.c' - shouldn't it be 'usr/local/lib/conftest.c' (without a blank space between '/usr/local/lib' and 'conftest.c')??


edited: SORRY for the double post! read the last one
hi there
i thought u figured out u r problem from the above post of yours
haven't u ????

maybe since it is not able to find the source file so it is giving the message cannot create executable

regards
 
Old 08-28-2004, 08:25 AM   #13
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Rep: Reputation: 30
Try changing the configuration file (I'm not sure what file it is, you never specified what you're trying to install / configure) to what you pointed out. The problem seems to be right here...

Quote:
/usr/local/lib conftest.c 1>&5
/usr/local/lib: file not recognized: Is a directory
Like you posted before. You just have to fix that problem by manually fixing it I'd guess.

If you don't know what file it is in (it should just be in the configuration file) do this inside of the install
directory:

Quote:
$ cat -n configure | grep "conftest.c" >> tmp.txt
Hopefully 'configure' is the file name for the configuration file. If not, just write that out with the configuration files name... you should be able find the line that it's on. (Just make sure you check tmp.txt.)
Then fire up vim and make chances accordingly.
 
Old 08-28-2004, 04:08 PM   #14
eomerek
LQ Newbie
 
Registered: Aug 2003
Location: Warsaw, Poland
Distribution: Mandrake 10
Posts: 18

Original Poster
Rep: Reputation: 0
I think it is not so simple as you wrote...

tmp. txt:
Quote:
2007 for ac_file in conftest.exe conftest conftest.*; do
2393 : > sub/conftest.c
2395 echo '#include "conftst'$i'.h"' >> sub/conftest.c
2416 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2418 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
3160 : > sub/conftest.c
3162 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3183 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
3185 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
I've looked in 'configure' file, but I haven't found anything what could help me...
Don't forget about one hing - is not important, which application you're trying to compile - in every case ./configure stops with message 'checking for C++ compiler default output... configure: error: C++ compiler cannot create executables' and config.log shows the same error with conftest.c...

When I try to reinstall gcc, during uninstallation of gcc an error message shows which says that many,many applications requires gcc (including XFree..)...
 
Old 09-09-2004, 09:14 AM   #15
HL247
LQ Newbie
 
Registered: Sep 2004
Location: The Netherlands
Distribution: Debian
Posts: 1

Rep: Reputation: 0
> checking for C compiler default output file name... configure: error: C compiler cannot create executables

I've had the same problem when trying to compile Apache 2 on my Debian box. After installing the Debian package: libc-dev te problem was gone.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C compiler cannot create executables packets Linux - Security 3 05-03-2010 05:30 PM
C++ compiler cannot create executables notmatt Linux - Newbie 4 09-30-2004 07:59 AM
C compiler cannot create executables w0lv3rin3 Linux - Software 4 08-07-2004 10:44 AM
My C compiler cannot create executables, help rbmako69 Linux - Software 15 06-16-2004 02:22 PM
C compiler cannot create executables londonboi Debian 2 09-23-2003 02:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration