c/c++中出现“undefined reference to”的解决
2012-12-09 23:37
225 查看
c/c++中出现“undefined reference to”的解决
“undefined reference to”的意思是,该函数未定义。如果使用的是gcc,有以下检查方案:
如果提示未定义的函数是某个库的函数。检查库时候已经安装,并在编译命令中采用-l和-L参数导入库。
如果提示未定义的函数是程序中的函数。检查是否在头文件中声明,是否在编译中有对应的obj文件。
如果提示未定义的函数是程序中的函数,还有一种很隐蔽的可能:检查改函数的代码的上下文是否有#ifdef或者#ifndef等预编译信息,这也很有可能导致相关代码没有被编译而出现“undefined reference to”提示。
相关文章推荐
- c/c++中出现“undefined reference to”的解决
- C++中Boost使用出现错误undefined reference to `boost::system::generic_category()'解决方法
- linux下开发,解决cocos2d-x中编译出现的一个小问题, undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
- 关于arm-linux-gcc交叉编译工具链,实现自己的crt0或者编译UBOOT出现undefined reference to `__aeabi_unwind_cpp_pr0'的解决方法
- 编译时出现undefined reference to `libiconv_open’的解决办法
- nios 中出现undefined reference to `__alt_invalid'alt_sys_init.c CC++ Problem的解决方法
- QT出现“undefined reference to `vtable for’”问题的原因及解决方法【转】
- 编译WU FTPD出现"undefined reference to crypt"错误解决方法
- QT出现“undefined reference to `vtable for’”问题的原因及解决方法
- 解决引用openssl静态库libcrypto.a和libssl.a出现undefined reference to错误的问题
- 移植Qt-4.8.5出现undefined reference to '__sync_sub_and_fetch_4'解决方法
- 解决webrtc2sip编译出现错误undefined reference to symbol 'dlopen@@GLIBC_2.1'
- 语言中编译连接出现undefined reference to ""的解决方法 (转)
- linux 链接库文件出现“undefined reference to" 问题的解决方法
- [原创].如何解决Nios II SBTE中出现的undefined reference to `xxx'警告
- C++报错集合:在Linkeage时出现undefined reference to `SPTraderController::writeAplLog(bfl::BString const&)'
- C++调用C静态库,出现undefined reference to “” 的问题
- PHP 5.3.10 编译安装时出现 undefined reference to `libiconv' 错误的解决方法
- arm编译QT4.8.5时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法
- 编译QT时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法