Mac OS:g ++无法添加框架支持 [英] mac os: g++ failed to add framework support

查看:113
本文介绍了Mac OS:g ++无法添加框架支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码:

#include <Security/Security.h>

int main() {
}

编译:

$ /Developer/usr/bin/g++  test.cpp  -framework Security
test.cpp:1:31: error: Security/Security.h: No such file or directory

或者:

$ /Developer/usr/bin/g++  test.cpp  -F /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Security.framework/
test.cpp:1:31: error: Security/Security.h: No such file or directory

系统信息
Mac:10.6.5
Xcode:3.2.5
G ++:i686-apple-darwin10-g ++-4.2.1

System Info
Mac: 10.6.5
Xcode: 3.2.5
G++: i686-apple-darwin10-g++-4.2.1

推荐答案

由于一天过去了,没有人回答我的问题,我想与可能遇到类似问题的人分享我的解决方案.

Since one day has passed and no one answered my question, I'd like to share my solution with those who might run into similar problems.

要在Framework支持下进行编译,请执行以下操作:

To compile with Framework support:

/Developer/usr/bin/g++ test.cpp -F/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks -L/Developer/SDKs/MacOSX10.6.sdk/usr/lib -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include

或者以一种更为优雅的方式:

Or in a more elegant way:

/Developer/usr/bin/g++ test.cpp -isysroot /Developer/SDKs/MacOSX10.6.sdk

这篇关于Mac OS:g ++无法添加框架支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆