Xcode 4.3.3找不到任何头文件 [英] Xcode 4.3.3 can't find any header files

查看:127
本文介绍了Xcode 4.3.3找不到任何头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我设法使Xcode链接到我安装在/usr/local/lib/下的Gnu科学库(GSL),以及在/usr/local/include下的头文件.在构建阶段">使用库链接二进制文件"下,我添加了libgsl.a等.今天,Xcode给出一条错误消息,声称找不到头文件.

Up until now I've managed to get Xcode to link to the Gnu Scientific Libraries (GSL) which I've installed under /usr/local/lib/ and with header files under /usr/local/include. Under "Build Phases" > "Link Binary With Libraries" I had added libgsl.a etc. Today, Xcode gives an error message claiming it can't find header files.

例如

#include <stdio.h>
#include <gsl/gsl_matrix.h>

int main(int argc, const char * argv[])
{

    printf("Hello, World!\n");
    return 0;
}

找不到"gsl/gsl_matrix.h"文件.我试图将用户标题搜索路径更改为无效.在命令行上使用gcc main.c -lgsl -lgslcblas可以完美地工作.谁能告诉我要使它在Xcode中正常工作需要做什么?另外,为什么它突然突然停止工作而没有明显的原因.

results in 'gsl/gsl_matrix.h' file not found. I've tried to change the User Header Search path to no avail. Using gcc main.c -lgsl -lgslcblas on the command line works perfectly. Could anyone tell me what exactly one needs to do to get this to work in Xcode? Also, why has it suddenly stopped working for no apparent reason.

非常感谢.

推荐答案

升级到4.3.3并在/usr/local/include文件夹中安装了include文件时,我遇到了同样的问题.经过一番敲打之后,我发现我必须将/usr/local/include添加到项目构建设置"中搜索路径"下的标题搜索路径"设置中.在XCode的先前版本中,我不必这样做.不知道为什么会改变,但是希望它对您有用.

I had same problem when I upgraded to 4.3.3 with include files installed in my /usr/local/include folder. After some head banging, I discovered that I had to add /usr/local/include to the "Header Search Paths" setting under Search Paths in Project Build Settings. I did NOT have to do that in the previous version of XCode. Don't know why it changed, but hope this works for you.

这篇关于Xcode 4.3.3找不到任何头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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