我有这个代码:
#include <iostream>
#include <mp4.h>
int main (int argc, char * const argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
MP4Read("filename", MP4_DETAILS_ALL );
return 0;
}
并且我已经将 -I/opt/local/include 和 -L/opt/local/lib 添加到路径(通过 macports 安装后 mp4 库所在的位置),但我得到的只是:
Undefined symbols: "_MP4Read", referenced from: _main in main.o ld: symbol(s) not found
即使 XCode 找到它并正确自动完成...
最佳答案
您最有可能需要链接库,即添加 -lmp4 或类似链接命令。
关于c++ - #include <lib.h> 找不到符号,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/667015/