Thursday, January 31, 2013
What is the proper way to compile c++ code from the terminal?
I'm using:
g++ char.gpp
And I get:
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
So I tried setting LIBRARY_PATH to a directory that contains crt1.10.6.o, but then I get:
ld: warning: in char.gpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
So clearly I am not picking up the right library, or perhaps just not all the libs needed. Why is this so hard? I haven't seen problems like this with earlier versions of Xcode.
I'm using the latest version of Xcode on a MacBook Pro with Lion installed.
Thanks,
Kim
Sunday, January 6, 2013
Re: I cannot compile "C" source file on Mac OS X(10.8.2)
If I run below command, got the error.
xcrun cc jukebox.c
jukebox.c:1:9: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
Re: I cannot compile "C" source file on Mac OS X(10.8.2)
If I run below command, got the error.
xcrun cc jukebox.c
jukebox.c:1:9: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
Re: I cannot compile "C" source file on Mac OS X(10.8.2)
If I run below command, got the error.
xcrun cc jukebox.c
jukebox.c:1:9: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
Re: I cannot compile "C" source file on Mac OS X(10.8.2)
If I run below command, got the error.
xcrun cc jukebox.c
jukebox.c:1:9: fatal error: 'stdio.h' file not found
#include
^
1 error generated.
I cannot compile "C" source file on Mac OS X(10.8.2)
Hi,
I am trying to compile the C source filein terminal, using "cc" or "gcc" command. No luck.
Later on, tried to ran the command, xcrun cc filename.c, the compiler gave an error about header files.










