cc compiler problem

niteowl

Registered
hello all,

I was trying to test the cc compiler in the terminal after I installed the development tools. I wrote the classical hello world program and typed the following in the terminal

cc hello.c -o hello.exe

and the compiler gave me this in return:

/usr/bin/ld: /usr/lib/libSystem.dylib load command 6 unknown cmd field

Does anyone know how I might be able to fix this?

Thanks.

Niteowl
 
What's the source look like? That would help some.

(plus, .exe isn't needed for executables in a *nix environment. It's nothing wrong, exactly, just not needed.)
 
The code is

#include<stdio.h>

main() {

printf("hello world\n");

}

I know the *.exe is not necessary, just somewhat my naming convention (bad influence from DOS), but thanks for the thoughts.

niteowl.
 
Which OS X version?
Which DevTools Version?

The problem you describe is likely to occur if you forgot to re-install the DevTools after updating OS X (happened to me after the 10.2.4 update, re-installing the DevTools cured it).
 
Thanks for the help.

It works fine now that I have upgraded to OSX.2.3. Perhaps the developers version I have was too old.

Thanks guys.

Happy coding.

niteowl.
 
Back
Top