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

Re: gcc: "cannot create executables" (confused now)



On Thursday 18 January 2001 00:28, D-Man wrote:
> (BTW, I'm assuming you don't know how to program)
>
> 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: