Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/124.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows上websocketpp和MySQL的Boost生成错误 我试图构建一个既使用WebSoCKPP又使用MySQL的C++应用程序。我使用VS 2010 C++ Express遇到了2个构建问题。p>_C++_Mysql_Visual Studio 2010_Boost_Websocket - Fatal编程技术网

Windows上websocketpp和MySQL的Boost生成错误 我试图构建一个既使用WebSoCKPP又使用MySQL的C++应用程序。我使用VS 2010 C++ Express遇到了2个构建问题。p>

Windows上websocketpp和MySQL的Boost生成错误 我试图构建一个既使用WebSoCKPP又使用MySQL的C++应用程序。我使用VS 2010 C++ Express遇到了2个构建问题。p>,c++,mysql,visual-studio-2010,boost,websocket,C++,Mysql,Visual Studio 2010,Boost,Websocket,1) boost库有一个问题。它会产生如下许多错误: 1>c:\program files (x86)\boost\boost_1_50\boost\thread\win32\thread_data.hpp(210): error C2146: syntax error : missing ')' before identifier 'rel_time' 以下是thread_data.hpp中的相关片段,从第210行开始: inline BOOST_SYMBOL_VISIBLE voi

1) boost库有一个问题。它会产生如下许多错误:

 1>c:\program files (x86)\boost\boost_1_50\boost\thread\win32\thread_data.hpp(210): error C2146: syntax error : missing ')' before identifier 'rel_time'
以下是thread_data.hpp中的相关片段,从第210行开始:

inline BOOST_SYMBOL_VISIBLE void sleep(TimeDuration const& rel_time)
    {
        interruptible_wait(detail::pin_to_zero(rel_time.total_milliseconds()));
    }
2) 与文字版本有冲突,我认为这是独立的

为了给boost构建问题提供一个清晰简单的示例,我使用了websocketpp示例:我在其中添加了以下内容:

#include "stdafx.h" 
Boost lib包括websocketpp站点上“使用websocketpp构建程序”推荐的内容

#include <boost/regex.hpp>
#include <boost/random.hpp> 
#include <boost/system/api_config.hpp>
#include <boost/system/config.hpp>
#include <boost/system/error_code.hpp>
#include <boost/system/system_error.hpp>
#include <boost/system/windows_error.hpp>
#包括
#包括
#包括
#包括
#包括
#包括
#包括
MySQL头文件包括。添加这两个boostincludes会触发生成错误。如果我注释掉这2个include,则它构建时不会出现错误:

#include <my_global.h>
#include <mysql.h>
#包括
#包括
关于如何处理增压问题有什么建议吗


我不认为这是与此相同的构建问题,“尝试使用MinGW构建websocket++:最后几个链接器错误-可能是什么?”

关于第一个错误,请检查是否有宏干扰代码。右键单击并转到“定义”或#在文件开头自己定义宏,然后查看在何处重新定义宏。在非常困难的情况下,通过编译器标志查看预处理器输出


关于其余部分,您没有为Boost和MySQL提供任何版本。然后是my_global.h(或者是MySQL的一部分?)和stdafx.h,它们都在您的控制之下,但您不在这里显示它们。另外,尝试将问题减少到尽可能小的代码段。简而言之,提供一个可重复的例子。

谢谢你,末日之星。第一个问题确实是一个宏观问题。有关更多详细信息,请参阅我原始邮件中的链接。在本文中,我的重点是第二个问题。h是Microsoft预编译头文件。我删除了它,得到了同样的错误。my_global.h是MySQL的一部分,所以这是问题的一部分。版本:Boost:Boost_1_50于2012年8月3日下载。MySQL:MySQL Connector C 6.0.2(2012年12月下载并安装)和mysql5.5.16(大约有一年历史)非常好——我将更新所有内容,看看boost问题是否仍然存在。有一点需要澄清:版本问题是一个宏。doomster,你认为boost问题也是宏观问题吗?TY…\boost_1_51\boost\config\thread_data.hpp
template inline boost_SYMBOL_VISIBLE void sleep(TimeDuration const&rel_time){interruble_wait(detail::pin_to_zero(rel_time.total_millides())}
正在…\mysql\mysql5.5.16\include\my_global.h第130行中作为宏“定义”进行处理,以解释错误。有没有办法在不编辑和重建boost或MySQL的情况下修复它?Doomster是正确的——这两个问题都是宏冲突。解决方案是使用pImple习惯用法包装MySQL的使用。