2013-11-24 4 views
0

http://dlib.net/bayes_net_ex.cpp.html visual studio 2013에서 제공되는 샘플 코드를 실행하려고하면 모든 라이브러리가 설정되었지만 요소 및 요소 const에 두 개의 c2244 오류가 발생합니다. 여기 오류 c2244 dlib 베이지안 네트워크 샘플 코드

내가 여기 무슨 잘못 볼 수 없습니다 오전 오류 보고서

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 ========== 

입니다.

답변

0

이것은 Visual Studio 2013의 버그입니다. binary_search_tree_kernel_c.h의 두 element() 함수 정의를 클래스 외부에서 클래스 내부로 이동하여 해결할 수 있습니다.