Visual Studio + Boost error
Visual Studio + Boost error
我正试图在Visual Studio C++Express 2010中使用Boost构建一个解决方案,但出现以下错误:
1>------ Build started: Project: MEDsLDAc, Configuration: Release Win32 ------
1> MedLDA.cpp
1>D:_downloadboost_1_53_0boost/math/constants/calculate_constants.hpp(152): error C2988: unrecognizable template declaration/definition
1>D:_downloadboost_1_53_0boost/math/constants/calculate_constants.hpp(152): error C2059: syntax error : 'constant'
1>D:_downloadboost_1_53_0boost/math/constants/calculate_constants.hpp(153): error C2143: syntax error : missing ')' before '>'
1>D:_downloadboost_1_53_0boost/math/constants/calculate_constants.hpp(184): error C2244: 'boost::math::constants::detail::constant_euler<T>::compute' : unable to match function definition to an existing declaration
1> definition
1> 'T boost::math::constants::detail::constant_euler<T>::compute(void)'
1> existing declarations
1> 'T boost::math::constants::detail::constant_euler<T>::compute(void)'
1>MedLDA.cpp(385): warning C4244: 'initializing' : conversion from 'double' to 'long', possible loss of data
1>MedLDA.cpp(426): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:Program FilesMicrosoft Visual Studio 10.0VCincludestring.h(105) : see declaration of 'strcpy'
1>MedLDA.cpp(485): warning C4244: 'initializing' : conversion from 'double' to 'long', possible loss of data
1>MedLDA.cpp(608): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:Program FilesMicrosoft Visual Studio 10.0VCincludestring.h(105) : see declaration of 'strcpy'
1>MedLDA.cpp(609): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:Program FilesMicrosoft Visual Studio 10.0VCincludestring.h(105) : see declaration of 'strcpy'
1>MedLDA.cpp(636): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:Program FilesMicrosoft Visual Studio 10.0VCincludestring.h(105) : see declaration of 'strcpy'
1>MedLDA.cpp(730): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
1>MedLDA.cpp(963): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
1>MedLDA.cpp(1150): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
1>MedLDA.cpp(1241): warning C4244: 'initializing' : conversion from 'double' to 'long', possible loss of data
1>MedLDA.cpp(1296): warning C4244: 'initializing' : conversion from 'double' to 'long', possible loss of data
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
如何修复?
更新:该软件为MedLDAc,可在此处获得:http://www.ml-thu.net/~jun/medda.shtml
作者说建筑适合他。
由于您还没有显示任何代码,我们只能猜测。我的猜测是,你#define
的某个宏扰乱了Boost.Math
的代码。也许像#define M ......
更新:事实证明我的猜测是正确的。看看MedLDAc/MEDsLDAc/cokus.h file
:
#define M (397) // a period parameter
立即的解决方法是将MedLDA.cpp
中的#include <boost/math/special_functions/gamma.hpp>
行移动到StdAfx.h
之后的第一个include,这样上述宏就不会影响gamma.hpp
中声明的模板。
附言:定义一个字母的宏是一个非常非常糟糕的主意。
相关文章:
- 链接 boost 库时"Error while loading shared libraries"引发的,除了我无法使用 root 访问权限来修复它
- 如何处理"Cmake Error: Unable to find the requested Boost libraries"?
- 尝试使用生成文件编译程序时"fatal error: boost/regex.hpp: No such file or directory" C++
- Boost Beast error basic_socket_acceptor
- 如何修复"fatal error: boost/asio.hpp: no such file or directory"?
- boost::spirit::qi::phrase_parser() into std::map error
- 当流媒体关闭流程时,应将boost :: async_read返回的bost :: async_read返回的error
- boost::asio error for UDP async_receive
- 使用 Boost.Log "error: target { simple_event_log.mc. } has no type" 构建 Boost
- 为什么该输出是 boost 程序 (boost::filesystem) 中的"Bus error: 10"?
- Boost asio error with Cygwin
- Boost asio, async_read error
- 不能在非 Boost 版本的 Asio 中使用 asio::p laceholders::error
- Boost asio & ssl & error code
- Boost asio Error 10054
- Visual Studio + Boost error
- 配置:error: no boost.找到文件系统库
- Borland C++ - Boost Library 1.55 Error
- boost 1.53 python fatal error LNK1104 boost_python-vc110-mt-
- error: ' boost::Q_FOREACH '没有被声明