日期:2014-05-16  浏览次数:21026 次

GCC编译连接问题/include/c++/4.4.7/bits/stl_algobase.h:343: undefined reference to
请linux大牛指教!
首先我在自己的ubuntu上面编译我的程序没有任何问题,但是移植到学校的高性能集群平台编译就出现了下面连接错误的问题,我本地ubuntu的gcc版本为:4.6.3,高性能集群平台gcc版本为:4.4.7:

=== linking: release/DenseTrack ===
g++ -L/opt/lib -L/home/huangng/software/boost/lib -L/home/huangng/software/opencv/lib -L/home/huangng/software/ffmpeg/lib -pipe -Wall -O3 -ggdb -o release/DenseTrack .build_release/DenseTrack.o -lboost_program_options -lboost_regex -lboost_system -lboost_filesystem -lopencv_core -lopencv_highgui -lopencv_video -lopencv_imgproc -lavformat -lavdevice -lavutil -lavcodec -lswscale
.build_release/DenseTrack.o: In function `main':
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:103: undefined reference to `IplImagePyramid::rebuild(IplImageWrapper)'
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:307: undefined reference to `IplImagePyramid::rebuild(IplImageWrapper)'
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:56: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:58: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:60: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:62: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
/home/huangng/lab/dense_trajectory_release_v1.1/DenseTrack.cpp:68: undefined reference to `IplImagePyramid::rebuild(IplImageWrapper)'
.build_release/DenseTrack.o: In function `IplImagePyramid':
/home/huangng/lab/dense_trajectory_release_v1.1/./opencv/IplImagePyramid.hpp:34: undefined reference to `IplImagePyramid::init(CvSize, int, int, double)'
.build_release/DenseTrack.o: In function `__copy_m<const IplImageWrapper*, IplImageWrapper*>':
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:343: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
.build_release/DenseTrack.o: In function `__copy_m<IplImageWrapper*, IplImageWrapper*>':
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:343: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
collect2: ld returned 1 exit status
make: *** [release/DenseTrack] Error 1


上述报undefined reference to 的函数和文件都是我程序里面的不是系统或者库函数,我怀疑最后两个错误提示:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:343: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
.build_release/DenseTrack.o: In function `__copy_m<IplImageWrapper*, IplImageWrapper*>':
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:343: undefined reference to `IplImageWrapper::operator=(IplImageWrapper const&)'
是不是说明gcc编译器有问题,还是我的环境配置哪里出了错误?纠结了几天了,希望大牛指教!!!!