2017-05-15 1 views
0

kmeans_seq.cbikmeans_seq.c 개의 파일이 있습니다. 파일 bikmeans_seq.c에는 kmeans_seq.hbikmeans_seq.h이라는 두 개의 헤더가 있습니다.여러 헤더 파일이있는 C 프로그램을 컴파일 할 때 오류가 발생했습니다.

Undefined symbols for architecture x86_64: 
    "_euclidean_dist", referenced from: 
     _points_assignment in bikmeans_seq-5c462b.o 
     _partition_clusters in bikmeans_seq-5c462b.o 
     _standard_deviation in bikmeans_seq-5c462b.o 
    "_find_max", referenced from: 
     _standard_deviation in bikmeans_seq-5c462b.o 
    "_kmeans", referenced from: 
     _main in bikmeans_seq-5c462b.o 
     _partition_clusters in bikmeans_seq-5c462b.o 
    (maybe you meant: _bisecting_kmeans) 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

나는이 오류가 무엇인지 확실하지 않다 : 나는 gcc bikmeans_seq.c -o bikmeans를 사용하여 bikmeans_seq.c를 컴파일 할 때 나는이 오류가 발생합니다. 누군가가 왜이 오류가 발생하는지 나에게 암시 할 수 있습니까? 고맙습니다. 소스없이

+1

어려운 소스가 없습니다. [mcve] –

+0

두 개의 C 파일은 어떻게 관련되어 있습니까? –

답변

0

는 조금 어렵지만,이 시도 :이 작동

gcc -Wall bikmeans_seq.c kmeans_seq.c -o bikmeans 

하더라도 내가 메이크 파일을 사용하는 것이 좋습니다 것입니다.

희망이 도움이됩니다.

+0

나는 출력이 clang을 사용하여 clang을 사용하고 있다고 생각한다. clang : error : 링커 명령이 종료 코드 1로 실패했다. (호출을보기 위해 -v를 사용한다.) ' – Toby

+1

@Toby 그는 "내가 컴파일 할 때 bikmeans_seq.c gcc bikmeans_seq.c -o bikmeans를 사용하여이 오류가 발생합니다. "하지만 동일한 의심의 여지가 있습니다. –

+1

Apple 시스템이어야합니다. 그들은 gcc에서 clang으로 옮겼을 때 완전히 엉망으로 만들었지 만 gcc와 clang을 연결 시켰습니다. Apple 사용자의 80 %는 gcc를 사용한다고 생각합니다. – Olaf

관련 문제