【发布时间】:2017-05-15 12:08:43
【问题描述】:
我有 kmeans_seq.c 和 bikmeans_seq.c 文件。文件bikmeans_seq.c 包括两个标题:kmeans_seq.h 和bikmeans_seq.h。当我使用 gcc bikmeans_seq.c -o bikmeans 编译 bikmeans_seq.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)
我不确定这个错误是什么。有人可以提示我为什么会收到此错误吗?谢谢。
【问题讨论】:
-
没有来源会很困难。请提供minimal reproducible example
-
这两个C文件有什么关系?
标签: c compiler-errors linker clang