来自命令行的以下调用clang++ vcfaltcount.cpp -o vcfac
,产生以下错误/警告
>In file included from vcfaltcount.cpp:1:
./Variant.h:86:5: warning: control may reach end of non-void function [-Wreturn-type]
}
>Undefined symbols for architecture x86_64:
"split(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in ccGOdUhH.o
vcf::VariantCallFile::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in ccGOdUhH.o
"vcf::VariantCallFile::getNextVariant(vcf::Variant&)", referenced from:
_main in ccGOdUhH.o
"vcf::VariantCallFile::parseHeader()", referenced from:
vcf::VariantCallFile::openFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in ccGOdUhH.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
还有许多其他关于“此类架构的未定义符号”的帖子,我试图使用这些建议来成功编译。
我认为问题可能来自头文件variant.h。在提供源代码的 API 中,有一个对应的 variant.cpp 文件定义了函数,这些函数仅在 variant.h 中声明。我将这些定义移到了 variant.h 中。关于我可能遗漏的任何想法?如果需要,我可以提供标题,但它很长。谢谢。