我正在为Raspberry Pi构建并且有未解析的系统符号

问题描述 投票:-1回答:1

我正在/为Raspberry Pi构建一个库,想知道这些丢失的符号在哪里,以及我如何链接到相应的库。

我编译

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

和链接

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

未定义的符号:

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
c++ gcc raspberry-pi3
1个回答
1
投票

您需要使用g ++而不是GCC链接目标文件。 GCC不添加所需的c ++库。

© www.soinside.com 2019 - 2024. All rights reserved.