2017-12-28 45 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 인수를 사용하여 오늘 유효하지 않은 것으로 보였습니다. 또한 링커가 많은 언어 중 하나를 컴파일하여 생성 될 수있는 네이티브 .o 모듈을 다루는 언어에 독립적이라고 생각했습니다. 올바른 라이브러리에 넣는 것은 "사용자"의 몫이었습니다. – peterk

답변

1

당신은 g의 오브젝트 파일을 링크 ++ 대신 GCC의 필요합니다. GCC는 필요한 C++ 라이브러리를 추가하지 않습니다.

+0

감사합니다. 이것으로 5/6을 제거했습니다. – peterk

+0

dladr 사람은 실종 된 libdl에서옵니다. – peterk