我正在尝试使用 LLVM 编译 ac 程序,但在获取一些静态库时遇到了麻烦。我已经使用 LLVM 成功编译了这些静态库,例如,存在 libogg.a 和 ogg.l.bc。
但是,当我尝试构建最终程序时,它不包含静态 ogg 库。我尝试了各种编译器选项,其中最值得注意的是:
gcc oggvorbis.c -O3 -Wall -I$OV_DIR/include -l$OV_DIR/lib/libogg.a -l$OV_DIR/lib/libvorbis.a -o test.exe
这将产生以下输出(为简洁起见缩短了目录):
$OV_DIR/include/vorbis/vorbisfile.h:75: warning: ‘OV_CALLBACKS_DEFAULT’ defined but not used
$OV_DIR/include/vorbis/vorbisfile.h:82: warning: ‘OV_CALLBACKS_NOCLOSE’ defined but not used
$OV_DIR/include/vorbis/vorbisfile.h:89: warning: ‘OV_CALLBACKS_STREAMONLY’ defined but not used
$OV_DIR/include/vorbis/vorbisfile.h:96: warning: ‘OV_CALLBACKS_STREAMONLY_NOCLOSE’ defined but not used
llvm-ld: warning: Cannot find library '$OV_DIR/lib/ogg.l.bc'
llvm-ld: warning: Cannot find library '$OV_DIR/lib/vorbis.l.bc'
WARNING: While resolving call to function 'main' arguments were dropped!
我觉得这很令人困惑,因为 $OV_DIR/lib/ogg.l.bc 确实存在,vorbis.l.bc 也存在,而且它们都可以被每个人读取(就像它们包含的目录一样)。
有谁知道我做错了什么?
谢谢,
马特