gpt4 book ai didi

c++ - 使用 boost::math::ibeta 时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:41:15 30 4
gpt4 key购买 nike

我已经安装了 boost_1_67_0,并使用了 lambda.hpp 中的函数以及正则表达式库来确认仅 header 函数和基于库的函数是否正常工作。

但是,下面的代码:

#include <boost/math/special_functions/gamma.hpp>
int main(int argc, char * argv[]) {
boost::math::ibeta((double)5, (double)1, (double)0.5);
}

抛出错误(Visual Studio Community 2017,15.5.2):

LNK2019 unresolved external symbol "double __cdecl boost::math::ibeta<double,double,double>(double,double,double)" (??$ibeta@NNN@math@boost@@YANNNN@Z) referenced in function _main ProjectName C:\PathToProject\ProjectName\main.obj   1   
LNK1120 1 unresolved externals

我尝试重新安装 boost,重新创建项目,在 x86 和 x64 之间切换(以及调试/发布),并使​​用 boost_1_66_0。还有其他想法我做错了什么吗?我可以确认的特定库中的 ibeta 是否存在,或者它是否仅包含 header ?

最佳答案

我使用了错误的包含 - 我应该使用 beta.hpp 而不是 gamma.hpp。此错误的来源是 boost 文档中列出的不正确包含 here . ibeta 的正确包含是

#include <boost/math/special_functions/beta.hpp>

ibeta 的正确文档是 here .上一个链接是针对旧版本的 boost(如果您 [我] 当前搜索“boost ibeta”,Google 会链接到该链接)。

关于c++ - 使用 boost::math::ibeta 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49955989/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com