【发布时间】:2015-03-31 16:38:31
【问题描述】:
我正在尝试使用libotr,但在尝试编译非常基本的库初始化时遇到以下问题。
#include <libotr/proto.h>
int main(int argc, char const *argv[])
{
OTRL_INIT;
// OtrlUserState userstate = otrl_userstate_create();
return 0;
}
我正在使用以下命令编译它:
g++ main.cpp -o main -L /usr/local/lib/ -lotr
但由于某种原因,我得到了:
Undefined symbols for architecture x86_64:
"otrl_init(unsigned int, unsigned int, unsigned int)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/bin] Error 1
我明确检查过,该库确实有以下符号。
【问题讨论】:
标签: c++ c symbols name-mangling