从ubuntu 10.10升级到11.10后的c ++编译错误

时间:2012-01-27 02:01:18

标签: c++ qt ubuntu-10.10 libjpeg ubuntu-11.10

我有一个c ++程序正在ubuntu 10.10上工作和编译。但是,当我升级到11.10时,我开始收到此错误消息:

g++ -rdynamic -o ../../../bin/camera Camera.o main.o moc_Camera.o    -L/home/myusername/Desktop/project/lib -L/usr/lib/i386-linux-gnu -ljpeg -lcfitsio -lavcodec -lavformat -lswscale -lfftw3 -lfftw3f -lcv -lgdal1.7.0 -lmatrox_fake -lbacktrace -lexceptions -limage -limage_display -lio -ljpeg_image -llog -lmetadata -lpipe -lpipebrowser -lplumber -lplumbing -lqt -lserial -ltime -lwebcam -Wl,-R/home/myusername/Desktop/project/lib -lQtXml -lQtGui -lQtCore -lpthread 
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_resync_to_restart'
/home/myusername/Desktop/project/lib/libplumber.so: undefined reference to `company::pipe::PipeBrowser::PipeBrowser()'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_std_error'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_CreateDecompress'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_start_compress'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_read_header'
/home/myusername/Desktop/project/lib/libqt.so: undefined reference to `ExceptionHandler::ExceptionHandler()'
/home/myusername/Desktop/project/lib/liblog.so: undefined reference to `Backtrace::add(void*)'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_destroy_decompress'
/home/myusername/Desktop/project/lib/libwebcam.so: undefined reference to `Exception::Exception(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/myusername/Desktop/project/lib/libimage.so: undefined reference to `Exception::Exception(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/myusername/Desktop/project/lib/libimage.so: undefined reference to `Exception::~Exception()'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_finish_compress'
/home/myusername/Desktop/project/lib/liblog.so: undefined reference to `Backtrace::~Backtrace()'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_destroy_compress'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_finish_decompress'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_set_defaults'
/home/myusername/Desktop/project/lib/liblog.so: undefined reference to `Backtrace::print(std::basic_ostream<char, std::char_traits<char> >&) const'
/home/myusername/Desktop/project/lib/libimage.so: undefined reference to `Exception::~Exception()'
/home/myusername/Desktop/project/lib/libimage.so: undefined reference to `typeinfo for Exception'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_start_decompress'
/home/myusername/Desktop/project/lib/libplumber.so: undefined reference to `ExceptionHandler::handle(Exception&)'
/home/myusername/Desktop/project/lib/liblog.so: undefined reference to `Backtrace::trace()'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_write_scanlines'
/home/myusername/Desktop/project/lib/liblog.so: undefined reference to `Backtrace::Backtrace()'
/home/myusername/Desktop/project/lib/libimage.so: undefined reference to `Exception::report(std::basic_ostream<char, std::char_traits<char> >&) const'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_CreateCompress'
/home/myusername/Desktop/project/lib/libjpeg_image.so: undefined reference to `jpeg_read_scanlines'
/home/myusername/Desktop/project/lib/libimage.so: undefined reference to `IOException::IOException(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/myusername/Desktop/project/lib/liblog.so: undefined reference to `checkIO(std::basic_ios<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status
make: *** [../../../bin/camera] Error 1

所有的库都在那里..所以我不确定为什么会有这些未定义的引用。有没有其他人在升级到11.10后遇到libjpeg库的这个问题,或者知道为什么升级会导致这个问题?

2 个答案:

答案 0 :(得分:1)

根据此bug report中的信息,重新安装JPEG库可能会解决问题。错误的标题是** libwebkit-1.0-2:未定义的符号:jpeg_resync_to_restart *以及记者如何解决问题:

  

我的系统似乎破了。重新安装libjpeg62之后,   libjpeg.so.62按预期成为libjpeg.so.62.0.0的符号链接。   升级路径中的某些内容肯定是错误的,但事实并非如此   libwebkit或libjpeg的问题。所以,关闭这个误报   现在的错误。

答案 1 :(得分:0)

发现所有.so库在编译时都缺少所有包含库的-l(libname),这就是为什么所有这些未定义的错误都被打印出来的原因。仍然想知道为什么没有他们在10.10而不是11.10 ...