Hi, all,
I am a newbie of MacOS. Now I am compiling a simple test.cc under it but ld error happened. So could you help me?
-MacOS: Darwin kernel Version 10.0.0
-Xcode: 2.5
-The content of test.cpp
int main()
{
;
return 0;
}
-The command I input: gcc test.cc
-The output Info.:
/PATH/OF/GCC/ld: /usr/lib/system/libmathCommon.A.dylib load command 4 unknown cmd field
collect2: ld returned 1 exit status
-What I have did before
I login as a normal user(not root) and
1> Faced a error of "no gcc", so add /PATH/OF/GCC to $PATH
2> Faced a error of "no lib", so add a new env viariable, that is LD_LIBRARY_PATH=/PATH/OF/SDK/usr/lib
Then, I faced the problem mentioned above. Hope your suggestion. Thank you!
BTW, I did google and found some answers about this kind of problem, but most of those are suggestion of updating OS or Xcode. But I cannot update them cause I am not root, and I heard that other people has compiled sucessfully on this environment.
Daqi
I am a newbie of MacOS. Now I am compiling a simple test.cc under it but ld error happened. So could you help me?
-MacOS: Darwin kernel Version 10.0.0
-Xcode: 2.5
-The content of test.cpp
int main()
{
;
return 0;
}
-The command I input: gcc test.cc
-The output Info.:
/PATH/OF/GCC/ld: /usr/lib/system/libmathCommon.A.dylib load command 4 unknown cmd field
collect2: ld returned 1 exit status
-What I have did before
I login as a normal user(not root) and
1> Faced a error of "no gcc", so add /PATH/OF/GCC to $PATH
2> Faced a error of "no lib", so add a new env viariable, that is LD_LIBRARY_PATH=/PATH/OF/SDK/usr/lib
Then, I faced the problem mentioned above. Hope your suggestion. Thank you!
BTW, I did google and found some answers about this kind of problem, but most of those are suggestion of updating OS or Xcode. But I cannot update them cause I am not root, and I heard that other people has compiled sucessfully on this environment.
Daqi