2013-12-20 7 views
6

ポイントクラウドライブラリの構築にはかなりの問題があります。私はUbuntuを実行しています.GCCとClangの3つのバージョンがあります(おそらく問題がある場所)。 PCLをビルドするためにUbuntuにバンドルされているg ++ 4.6を使用しようとしていますが、これは私が試したコンパイラの中で最も遠いと思われます。しかし、私はこの問題があります:g ++ undefinedポイントクラウドライブラリを構築するときのシンボル '__cxa_free_exception @@ CXXABI_1.3'への参照

> Linking CXX executable ../../bin/pcl_convert_pcd_ascii_binary cd /home/oni/Projects/pcl/build/io/tools && /usr/bin/cmake -E cmake_link_script CMakeFiles/pcl_convert_pcd_ascii_binary.dir/link.txt 
--verbose=1 /usr/bin/g++ -lstdc++ -pthread -fopenmp -Wno-deprecated -O2 -g -lstdc++ -Wl,--as-needed CMakeFiles/pcl_convert_pcd_ascii_binary.dir/convert_pcd_ascii_binary.cpp.o 
-o ../../bin/pcl_convert_pcd_ascii_binary -rdynamic -L/usr/local/lib -L/home/oni/Projects/OpenNI/Lib /usr/local/lib/libboost_serialization.so /usr/local/lib/libboost_mpi.so /usr/local/lib/libboost_system.so /usr/local/lib/libboost_filesystem.so /usr/local/lib/libboost_thread.so /usr/local/lib/libboost_date_time.so /usr/local/lib/libboost_iostreams.so -lpthread -lm ../../lib/libpcl_common.so.1.7.1 ../../lib/libpcl_io.so.1.7.1 ../../lib/libpcl_common.so.1.7.1 ../../lib/libpcl_io_ply.so.1.7.1 /usr/local/lib/libboost_serialization.so /usr/local/lib/libboost_mpi.so /usr/local/lib/libboost_system.so /usr/local/lib/libboost_filesystem.so /usr/local/lib/libboost_thread.so /usr/local/lib/libboost_date_time.so /usr/local/lib/libboost_iostreams.so -lm /usr/lib/libvtkWidgets.so.5.8.0 /usr/lib/libvtkHybrid.so.5.8.0 /usr/lib/libvtkParallel.so.5.8.0 /usr/lib/libvtkVolumeRendering.so.5.8.0 /usr/lib/libvtkRendering.so.5.8.0 /usr/lib/libvtkIO.so.5.8.0 /usr/lib/libvtkImaging.so.5.8.0 /usr/lib/libvtkGraphics.so.5.8.0 /usr/lib/libvtkFiltering.so.5.8.0 /usr/lib/libvtkCommon.so.5.8.0 /usr/lib/libvtksys.so.5.8.0 -ldl -lm -lpng -lusb-1.0 -lOpenNI 
-Wl,-rpath,/usr/local/lib:/home/oni/Projects/pcl/build/lib:/usr/lib/openmpi/lib:/home/oni/Projects/OpenNI/Lib: 
-Wl,-rpath-link,/usr/lib/openmpi/lib /usr/bin/ld: CMakeFiles/pcl_convert_pcd_ascii_binary.dir/convert_pcd_ascii_binary.cpp.o: undefined reference to symbol '[email protected]@CXXABI_1.3' /usr/bin/ld: note: '[email protected]@CXXABI_1.3' is defined in DSO /usr/local/lib/libstdc++.so so try adding it to the linker command line /usr/local/lib/libstdc++.so: could not read symbols: Invalid operation collect2: ld returned 1 exit status make[2]: *** [bin/pcl_convert_pcd_ascii_binary] Error 1 make[2]: Leaving directory `/home/oni/Projects/pcl/build' make[1]: *** [io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/all] Error 2 make[1]: Leaving directory `/home/oni/Projects/pcl/build' make: *** [all] Error 2 

リンカからの無効な操作は本当に奇妙です。私がしようとした場合しかし、

g++ hello.cpp /tmp/cc29vkpU.o: In function `main': hello.cpp:(.text+0xa): undefined reference to `std::cout' hello.cpp:(.text+0xf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /tmp/cc29vkpU.o: In function `__static_initialization_and_destruction_0(int, int)': hello.cpp:(.text+0x3d): undefined reference to `std::ios_base::Init::Init()' hello.cpp:(.text+0x42): undefined reference to `std::ios_base::Init::~Init()' collect2: ld returned 1 exit status 

g++ hello.cpp -lstdc++ 

はすべてが順調である

# include <iostream> 
int main() { 
    std::cout << "Hello, world!\n"; 
} 

続く:私も試したことの一つは、これをしました。

g++ -v 
Using built-in specs. 
COLLECT_GCC=g++ 
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

私はかなり混乱していますが、私の現在のg ++​​セットアップと私のlibstdC++ライブラリとは関係があります。私はベンは、私はちょうどこれと同じ症状に走った、と同じ溶液が(-lstdC++)私のために働いた

+0

本当に-lstdC++が必要ですか? – AlexT

+0

gccはコマンドラインでライブラリを注文するのが非常に難しいことを覚えています(依存関係は依存する必要があります)。-lstdC++をコマンドラインの最後に押し付けようとします。 – AlexT

+0

私はそれを試してみます - ありがとう! – Oni

答えて

5

乾杯

apt-getを再インストールしようとしたが、ほとんど成功してきました。あなたが最近Ubuntu 12から14にアップグレードしたか、それともgccのアップグレードに相当するものがありましたか?

私はthis bloggerと同じボートにいるようですが、Ubuntu 12.04から14.04にアップグレードしたばかりです。

彼が書いたように:

をUbuntuの14.04は、GCCコンパイラとライブラリの新しいバージョンを使用しています。ここでのヒントは、__cxa_free_exceptionというコアのC++シンボルについての不満です。リンカが標準のC++ライブラリにリンクするように提案して、このエラーを修正しました。これを行うには、-lstdC++をリンカー呼び出しに追加します。

+1

ありがとうございます。私の場合、私はCMake "lstdC++"をtarget_link_librariesに追加しました。たとえば、target_link_libraries(foobar -lsomelibrary -lstdC++)です。 – Francuz

関連する問題