[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

gcc: "cannot create executables"



>>when attempting to compile a program i receive the following error message:
>>
>>
>>checking whether the C++ compiler (c++  ) works... no    
>>configure: error: installation or configuration problem: C++ compiler 
>>cannot create executables.
>>
>>
>>when doing a ./configure on licq in /usr/local/src/licq-xxxx after su-ing 
to root. 
>>
>>does anyone know what the problem could be?


> Try pasting the following into a file (call it foo.c) and then run
> the command:
>
> $ gcc foo.c
> $ ./a.out
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /* this is the text to put in a file */
> #include <stdio.h>
>
> int
> main( int argc , char** argv )
> {
>        printf( "Hello World.\n" ) ;
>        return 0 ;
> }
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> If that works (doesn't give any errors, prints Hello World), then your
> C compiler is working.  Try the command
>
> $ rm a.out
> $ g++ foo.c++
> $ ./a.out
>
>
> with the following in the file "foo.c++"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> // include this text in foo.c++
>
> #include <iostream>
>
> int
> main( int argc , char** argv )
> {
>        cout << "Hello World from C++." << endl ;
>        return 0 ;
> }
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> If that works (again, no errors, prints Hello World from C++), then
> your C++ compiler is working.
>
>
> If either of those don't work, report the file contents (in case a
> typo was made) and the error messages (with the shell commands, of
> course) to the list.
>
> HTH,
> -D
>
>
> PS.  Say, do you have write permission on the directory you are
> running configure in?  Is the disk full?


just now i unpacked the source to my home dir (after first unpacking it to 
/usr/local/src) so i dont think the permissions are the prob (i've also run 
chown -R currentuser * on the dir, eventhough that should be set-up properly 
when it gets unpacked no?). checked diskspace, a few hundred MBs should be 
sufficient for a few MBs of source code.

i compiled foo.c++ with gcc, no probs, no error messages, a.out gave the 
right output (Hello World).

I doubt its a prob with the source code (licq snapshot) because i've had a 
problem with another app i wanted to compile earlier today. 



Reply to: