C++ 使用boost::math::ibeta时出错
我已经安装了boost_1_67_0,并使用lambda.hpp和regex库中的函数来确认仅标头函数和基于库的函数是否正常工作 但是,以下代码:C++ 使用boost::math::ibeta时出错,c++,visual-c++,boost,C++,Visual C++,Boost,我已经安装了boost_1_67_0,并使用lambda.hpp和regex库中的函数来确认仅标头函数和基于库的函数是否正常工作 但是,以下代码: #include <boost/math/special_functions/gamma.hpp> int main(int argc, char * argv[]) { boost::math::ibeta((double)5, (double)1, (double)0.5); } #包括 int main(int argc,
#include <boost/math/special_functions/gamma.hpp>
int main(int argc, char * argv[]) {
boost::math::ibeta((double)5, (double)1, (double)0.5);
}
#包括
int main(int argc,char*argv[]){
boost::math::ibeta((双)5,(双)1,(双)0.5);
}
抛出错误(Visual Studio Community 2017,15.5.2):
LNK2019未解析外部符号“double\uu cdecl boost::math::ibeta(double,double,double)”(?)$ibeta@NNN@math@boost@@YANNNN@Z)在函数\u main ProjectName C:\PathToProject\ProjectName\main.obj 1中引用
LNK1120 1未解析的外部
我尝试重新安装boost,重新创建项目,在x86和x64之间切换(以及调试/发布),并使用boost_1_66_0。你知道我做错了什么吗?ibeta是否存在于我可以确认的特定库中,或者它只是标题?我使用了错误的include-我应该使用beta.hpp而不是gamma.hpp。此错误的来源是boost文档中列出的错误包含。ibeta的适当包括:
#include <boost/math/special_functions/beta.hpp>
#包括
ibeta的正确文档如下所示。上一个链接是针对boost的旧版本(如果您[I]目前正在搜索“boost ibeta”,谷歌会链接到该版本)。做得好,请编辑问题之外的“答案”部分,并将其作为自我答案发布。那东西对别人有用。
#include <boost/math/special_functions/beta.hpp>