sid*_*yll 8 macos linker gcc compilation objective-c
GCC手册说:
file.m
Objective-C source code. Note that you must link with the
libobjc
library yo make an Objective-C program work.
和:
-lobjc
You need this special case of the
-l
option in order to link an
Objective-C or Objective-C++ program.
但是,我可以简单地成功编译一个程序:
$ cc prg.m -framework Foundation
Run Code Online (Sandbox Code Playgroud)
当您包含框架时,它是链接器默认值吗?如果是这样,它在哪里记录?该程序无论如何都会链接:
$ otool -L a.out
a.out:
/System/Library/Frameworks/Foundation.framework/.../Foundation (...)
/usr/lib/libSystem.B.dylib (...)
--> /usr/lib/libobjc.A.dylib (...)
/System/Library/Frameworks/CoreFoundation.f...k/.../CoreFoundation (...)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1280 次 |
最近记录: |