当前位置: 技术问答>linux和unix
GCC编译连接问题/include/c++/4.4.7/bits/stl_algobase.h:343: undefined reference to
来源: 互联网 发布时间:2017-05-25
本文导语: 请linux大牛指教! 首先我在自己的ubuntu上面编译我的程序没有任何问题,但是移植到学校的高性能集群平台编译就出现了下面连接错误的问题,我本地ubuntu的gcc版本为:4.6.3,高性能集群平台gcc版本为:4.4.7: === linking: release/Dens...
请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':
/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':
/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':
/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编译器有问题,还是我的环境配置哪里出了错误?纠结了几天了,希望大牛指教!!!!
首先我在自己的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':
/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':
/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':
/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编译器有问题,还是我的环境配置哪里出了错误?纠结了几天了,希望大牛指教!!!!
|
首先,不太清楚你所说的高性能集群平台是否与你编译版本时所使用的环境一致,按说是要一致编译好的版本才可以再高性能集群平台上,才可以成功运行的。先搞清楚你编译版本的环境是否与高性能集群平台上的环境一致,比如操作系统版本,gcc版本是否一致,是否需要交叉编译