Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-opus-4-20250514-thinking-16k· AnthropicHugging Face LMArena Human Preference 140K

-lstdc++를 추가했더니, 기존에 사용하던 libp_topo.so: undefined reference to 'GeometryFactory:: ~ 라는…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with o3-mini’s answer.
  1. User

    -lstdc++를 추가했더니, 기존에 사용하던 libp_topo.so: undefined reference to 'GeometryFactory:: ~ 라는 에러가 뜨네

  2. Claude Assistant

    이 문제는 라이브러리 링크 순서 문제로 보입니다. 리눅스 링커는 왼쪽에서 오른쪽으로 라이브러리를 처리하기 때문에, 의존성이 있는 라이브러리들의 순서가 중요합니다.

    libp_topo.so가 GeometryFactory 클래스를 사용하는데, 이 클래스가 정의된 라이브러리가 링크 명령에서 libp_topo.so 뒤에 와야 합니다.

    일반적인 해결 방법:

    1. 링크 순서 조정: 의존성이 있는 라이브러리를 뒤로 배치
    g++ -o 프로그램명 소스.cpp -lp_topo -lgeometry_라이브러리 -lstdc++
    
    1. 순환 의존성이 있는 경우: --start-group과 --end-group 사용
    g++ -o 프로그램명 소스.cpp -Wl,--start-group -lp_topo -lgeometry_라이브러리 -Wl,--end-group -lstdc++
    
    1. 필요한 라이브러리 확인: GeometryFactory가 어느 라이브러리에 있는지 확인
    nm -D *.so | grep GeometryFactory
    

    정확한 해결을 위해서는 전체 링크 명령과 사용 중인 라이브러리들의 의존성 관계를 확인해야 합니다.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.

Identical first prompt