我有kmeans_seq.c
和bikmeans_seq.c
个文件。文件bikmeans_seq.c
包含两个标题:kmeans_seq.h
和bikmeans_seq.h
。当我使用bikmeans_seq.c
编译gcc bikmeans_seq.c -o bikmeans
时,我收到此错误:
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)
我不确定这个错误是什么。有人可以暗示我为什么会收到此错误吗?谢谢。
答案 0 :(得分:0)
Without sources is a bit difficult but try this:
gcc -Wall bikmeans_seq.c kmeans_seq.c -o bikmeans
Even if this will work I would suggest to use a makefile.
Hope this helps!