2017-12-28 43 views
-1

私はラズベリーパイのライブラリを構築していますが、これらの不足しているシンボルの場所と適切なライブラリへのリンク方法を知りたいと思います。私はラズベリーパイのためにビルドしており、未解決のシステムシンボルを持っています

私は

gcc -pthread -shared -shared-libgcc ... (objs, libs) 

未定義のシンボルで

G++ -pthread -x c++ -std=c++11 ... source 
// note this also with gcc same problem whether g++ or gcc command 

とリンクしてコンパイルします。

undefined reference to `__cxa_end_catch' 
undefined reference to `ceil' 
undefined reference to `__cxa_guard_release' 
undefined reference to `std::allocator<char>::allocator()' 
undefined reference to `__dynamic_cast' 
undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' 
undefined reference to `std::string::operator=(char const*)' 
undefined reference to `__cxa_begin_catch' 
undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)' 
undefined reference to `__cxa_rethrow' 
undefined reference to `typeinfo for artd::Thread' 
undefined reference to `__cxa_guard_abort' 
undefined reference to `__cxa_demangle' 
undefined reference to `std::__throw_length_error(char const*)' 
undefined reference to `dladdr' 
undefined reference to `std::__throw_bad_alloc()' 
undefined reference to `std::allocator<char>::~allocator()' 
undefined reference to `__cxa_guard_acquire' 
collect2: error: ld returned 1 exit status 
+0

リンクに 'g ++ 'を使わないのはなぜですか? – Quentin

+0

私は古いビルドスクリプトのC++のために、私はgccを使っていましたが、今日無効と思われる-stdlib = xxx引数を使っていました。また、リンカは、多くの言語のうちの1つをコンパイルすることによって生成されたネイティブの.oモジュールを扱う言語に依存しないと考えていました。そして、適切なライブラリに入れるのはユーザーの責任でした。 – peterk

答えて

1

あなたはG ++の代わりに、GCCとオブジェクトファイルをリンクする必要があります。 GCCは必要なC++ライブラリを追加しません。

+0

ありがとうございます - これは5/6を取り除いてしまいました。 – peterk

+0

dladrは、欠落していたlibdlに由来します。 – peterk

関連する問題