Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mavericks:找不到-lwfdb的库_C_Linker_Clang_Header Files_Osx Mavericks - Fatal编程技术网

Mavericks:找不到-lwfdb的库

Mavericks:找不到-lwfdb的库,c,linker,clang,header-files,osx-mavericks,C,Linker,Clang,Header Files,Osx Mavericks,从10.8移动到10.9中断了我的安装,找不到-lwfdb的库 这个节目 #include <wfdb/wfdb.h> int main(void) { return 0; } 我还尝试添加-L/usr/lib(其中libwfdb.10.5.20.dylib,libwfdb.10.dylib和libwfdb.dylib都位于其中),但ld仍然找不到-lwfdb 似乎小牛完全被删除了gcc。LD\u LIBRARY\u路径似乎只是运行时路径。在山狮的带领下,一切顺利我还应该尝试什么

10.8
移动到
10.9
中断了我的安装,找不到
-lwfdb
的库

这个节目

#include <wfdb/wfdb.h>
int main(void) { return 0; }

我还尝试添加
-L/usr/lib
(其中
libwfdb.10.5.20.dylib
libwfdb.10.dylib
libwfdb.dylib
都位于其中),但
ld
仍然找不到
-lwfdb

似乎小牛完全被删除了
gcc
LD\u LIBRARY\u路径
似乎只是运行时路径。在山狮的带领下,一切顺利我还应该尝试什么?


解决办法 仔细阅读
clang
-v
erbose输出后(下面继续)

568~/clang-v-I/usr/include c.c-o c-lwfdb
苹果LLVM版本5.0(clang-500.2.79)(基于LLVM 3.3svn)
目标:x86_64-apple-darwin13.0.0
线程模型:posix
“/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/usr/bin/clang”-cc1-triple x86_64-apple-macosx10.9.0-emit obj-mrelax all-disable free-disable llvm verifier-main file name c.c-mrelocation model pic-pic level 2-mdisable fp elim-masm verbose-munwind tables-target cpu core2-target linker version 224.1-v-resource dir/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xtoolschain/usr/bin//lib/clang/5.0-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk-I/usr/include-fdebug编译目录/Users/blaise/-ferror限制19-fmessage长度170-stack protector 1-mstackreallign-fblocks-fobjc运行时=macosx-10.9.0-fobjc调度方法=混合-fobjc默认合成属性-fencode扩展块签名-FDDiagnostics show选项-fcolor diagnostics-o/var/folders/64/3l9hbm994q37l_bw79kf15bm0000gp/T/c-2ILU4.o-x c.c
clang-cc1 5.0版基于LLVM 3.3svn默认目标x86_64-apple-darwin13.0.0
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/local/include”
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/Library/Frameworks”
#包括“…”搜索从这里开始:
#包括搜索从这里开始:
/usr/包括
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/./lib/clang/5.0/include
/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/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(框架目录)
搜索列表结束。
“/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/usr/bin/ld”-demangle-dynamic-arch x86_64-macosx_version_min 10.9.0-syslibroot/Applications/Xcode.app/Contents/Developer/Platforms/macosx.platform/Developer/SDKs/MacOSX10.9.sdk-o c/var/folders/64/3l9hbm994q37l\u bw79kf15bm0000gp/T/c-2iLIU4.o-lwfdb-lSystem/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolchain/usr/bin/./lib/clang/5.0/lib/darwin/libclang\u rt.osx.a
ld:找不到-lwfdb的库
叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用)
。。。我将
libwfdb.10.5.20.dylib
libwfdb.dylib
ln-s
ed放在
/usr/lib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/
中的第1个文件中

该程序现在链接良好但是,这肯定不是一个长期的解决方案?在10.9中,最好的方法是什么?例如,在当前
-syslibroot
中添加指向
/usr/lib
的链接会在每次Xcode升级时中断。。。不好

已尝试将
/usr/include
添加到
$PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:

好吧,那是行不通的
$PATH
是可执行文件的搜索路径


您应该将
/usr/include
添加到include路径。通过编译器调用—只需将
-I/usr/include
添加到命令行—或以我不知道的
clang
-特定方式。

尝试
clang-v-I/usr/include c.c-o c-lwfdb
获取搜索
-lwfdb
clang
尝试执行的详细输出。然后,验证文件是否存在。

我确实尝试了
-I/usr/include
调用。现在,
致命错误:“wfdb/wfdb.h”文件找不到了
,但是
-l
选项仍然会触发链接器错误:
ld:library not found for-lwfdb
@courteous然后使用
-l
将库的路径添加到链接器路径中。我已手动将
wfdb
库放在
ld
的搜索路径中;程序现在链接。对我更新的问题有什么建议吗?@有礼貌,为什么你不喜欢
-L/path/to/library
?已经尝试了,但没有成功:
-L/usr/lib
仍然无法链接。(这一尝试在问题的历史中已经存在;只是想让它保持简短。)尽管如此,这一自由党肯定不是唯一一个在小牛统治下被打破的自由党。。。这不可能是前进的方向。:)
567 ~/  clang -I/usr/include c.c -o c -lwfdb
ld: library not found for -lwfdb
568 ~/  clang -v -I/usr/include c.c -o c -lwfdb
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name c.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 224.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -I /usr/include -fdebug-compilation-dir /Users/blaise/ -ferror-limit 19 -fmessage-length 170 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0 -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fencode-extended-block-signature -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/64/3l9hbm994q37l_bw79kf15bm0000gp/T/c-2iLIU4.o -x c c.c
clang -cc1 version 5.0 based upon LLVM 3.3svn default target x86_64-apple-darwin13.0.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:
 /usr/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/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.
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -o c /var/folders/64/3l9hbm994q37l_bw79kf15bm0000gp/T/c-2iLIU4.o -lwfdb -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/lib/darwin/libclang_rt.osx.a
ld: library not found for -lwfdb
clang: error: linker command failed with exit code 1 (use -v to see invocation)