OSX gcc没有找到已安装的库

 莫一鸣2012 发布于 2022-12-25 22:29

我重新发现我刚刚安装编译C的恐怖libtins从http://libtins.github.io,通常如下./configure- > make- > sudo make install模式.

sudo make install肯定把标题放入,/usr/local/include/tins但它似乎不能g++看到它们.

按照这里的建议,我尝试运行gcc -x c++ -v -E /dev/null以查看包含路径.

clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin13.3.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks (framework directory)
End of search list.

我原本希望能/usr/local/include在某处看到.现在Xcode应用程序内的默认路径路径是否全部?

app.cpp

#include 

int main() {
    return 1;
}

编译命令

g++ app.cpp -ltins

结果

app.cpp:3:10: fatal error: 'tins/tins.h' file not found

知道如何g++查看标题吗?

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有