首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误c2244 dlib贝叶斯网络示例代码

错误c2244 dlib贝叶斯网络示例代码
EN

Stack Overflow用户
提问于 2013-11-25 04:38:41
回答 1查看 226关注 0票数 0

我正在尝试在visual studio 2013中运行这里提供的示例代码,所有的库都已经设置好了,但是我在http://dlib.net/bayes_net_ex.cpp.html和element const方法上得到了两个c2244错误。

这是错误报告

代码语言:javascript
复制
1>------ Build started: Project: bayesian, Configuration: Debug Win32 ------
1>  stdafx.cpp
1>  bayesian.cpp
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\dlib\binary_search_tree\binary_search_tree_kernel_c.h(187): error C2244: 'dlib::binary_search_tree_kernel_c<bst_base>::element' : unable to match function definition to an existing declaration
1>          definition
1>          'const dlib::map_pair<bst_base::domain_type,bst_base::range_type> &dlib::binary_search_tree_kernel_c<bst_base>::element(void) const'
1>          existing declarations
1>          'dlib::map_pair<binary_search_tree_kernel_c<bst_base>::::domain_type,binary_search_tree_kernel_c<bst_base>::::range_type> &dlib::binary_search_tree_kernel_c<bst_base>::element(void)'
1>          'const dlib::map_pair<binary_search_tree_kernel_c<bst_base>::::domain_type,binary_search_tree_kernel_c<bst_base>::::range_type> &dlib::binary_search_tree_kernel_c<bst_base>::element(void) const'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\dlib\binary_search_tree\binary_search_tree_kernel_c.h(205): error C2244: 'dlib::binary_search_tree_kernel_c<bst_base>::element' : unable to match function definition to an existing declaration
1>          definition
1>          'dlib::map_pair<bst_base::domain_type,bst_base::range_type> &dlib::binary_search_tree_kernel_c<bst_base>::element(void)'
1>          existing declarations
1>          'dlib::map_pair<binary_search_tree_kernel_c<bst_base>::::domain_type,binary_search_tree_kernel_c<bst_base>::::range_type> &dlib::binary_search_tree_kernel_c<bst_base>::element(void)'   
1>          'const dlib::map_pair<binary_search_tree_kernel_c<bst_base>::::domain_type,binary_search_tree_kernel_c<bst_base>::::range_type> &dlib::binary_search_tree_kernel_c<bst_base>::element(void) const'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我看不出这里出了什么问题。

EN

回答 1

Stack Overflow用户

发布于 2013-11-25 12:11:11

这是visual studio 2013中的一个错误。您可以通过将binary_search_tree_kernel_c.h中两个元素()函数的定义从类外部移动到类内部来解决这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20180674

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档