2

オングストローム Linux 用のアプリケーションを構築しようとしています (私の場合は、libstdc++ の代わりに uclibc を使用します)。私はbitbakeとopenembeddedを使用しています。-muclibcシンプルなツールチェーンを使用すると、フラグを追加するだけでビルドを成功させることができます。bitbake を使用すると、ビルド コマンドは次のようになります。

arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb --sysroot=/home/hnsl/stuff/tmp/sysroots/armv7a-angstrom-linux-gnueabi -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb2 -Wl,-O1 -Wl,--hash-style=gnu -muclibc mainThread.cpp lib.cpp -lportaudio

どこ-muclibc mainThread.cpp lib.cpp -lportaudioが私によって行われます。ポートオーディオ ( -lportaudio) は正常にリンクされました。Uclibc (私が思うに) はリンクできません。次のエラーが表示されます。

 /tmp/ccW4SVb4.o: In function `main':
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_end_cleanup'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_begin_catch'
| /tmp/ccW4SVb4.o: In function `operator<< <std::char_traits<char> >':
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:513: undefined reference to `std::cerr'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:513: undefined reference to `std::cerr'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:513: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
| /tmp/ccW4SVb4.o: In function `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))':
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:113: undefined reference to `std::cerr'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:113: undefined reference to `std::cerr'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:113: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
| /tmp/ccW4SVb4.o: In function `main':
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_end_catch'
| /tmp/ccW4SVb4.o: In function `operator<< <std::char_traits<char> >':
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:511: undefined reference to `std::cerr'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/ostream:511: undefined reference to `std::cerr'
| /tmp/ccW4SVb4.o: In function `std::basic_ios<char, std::char_traits<char> >::setstate(std::_Ios_Iostate)':
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/bits/basic_ios.h:148: undefined reference to `std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
| /tmp/ccW4SVb4.o: In function `main':
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_end_catch'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/mainThread.cpp:68: undefined reference to `__cxa_end_cleanup'
| /tmp/ccW4SVb4.o: In function `__static_initialization_and_destruction_0':
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/iostream:73: undefined reference to `std::ios_base::Init::Init()'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/iostream:73: undefined reference to `std::ios_base::Init::~Init()'
| /home/hnsl/stuff/tmp/sysroots/x86_64-linux/usr/armv7a/lib/gcc/arm-angstrom-linux-gnueabi/4.5.3/../../../../arm-angstrom-linux-gnueabi/include/c++/4.5.3/iostream:73: undefined reference to `std::ios_base::Init::~Init()'
| /tmp/ccW4SVb4.o:(.ARM.extab+0x0): undefined reference to `__gxx_personality_v0'
| /tmp/ccW4SVb4.o:(.ARM.extab+0x28): undefined reference to `typeinfo for char const*'
| /tmp/ccUEShoN.o: In function `endOnError(void*, int, char*)':
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:23: undefined reference to `__cxa_allocate_exception'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:23: undefined reference to `typeinfo for char const*'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:23: undefined reference to `typeinfo for char const*'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:23: undefined reference to `__cxa_throw'
| /tmp/ccUEShoN.o: In function `initFramework(char**, void**, PaStreamParameters*, PaStreamParameters*)':
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:32: undefined reference to `__cxa_allocate_exception'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:32: undefined reference to `typeinfo for char const*'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:32: undefined reference to `typeinfo for char const*'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:32: undefined reference to `__cxa_throw'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:37: undefined reference to `__cxa_allocate_exception'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:37: undefined reference to `typeinfo for char const*'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:37: undefined reference to `typeinfo for char const*'
| /home/hnsl/stuff/tmp/work/armv7a-angstrom-linux-gnueabi/cphone-1.0.0-r1/lib.cpp:37: undefined reference to `__cxa_throw'
| collect2: ld returned 1 exit status

ありがとう

4

1 に答える 1

1

g++C++ コードをコンパイルおよびリンクするには、実際に使用する必要があります。標準 C++ ライブラリの正しいインクルード パスとリンカー オプションを追加します。

でそれを行うことは可能ですgccが、常にg++コンパイルとリンクの両方を使用する方がはるかに簡単です。

于 2012-05-20T16:13:13.140 に答える