mingw STLport配合boost::thread库或gSoap时编译错误

mingw 使用STLport配合boost::thread库或gSoap时,编译时会报以下错误

原文:http://sourceforge.net/projects/stlport/forums/forum/490891/topic/3036652

                 from ../Source/./gSoap/Linux/stdsoap2.h:663,
                 from ../Source/./gSoap/Linux/soapStub.h:11,
                 from ../Source/./gSoap/Linux/soapH.h:10,
                 from ../Source/./gSoap/Linux/Service.nsmap:2,
                 from ../Source/gSoap/SoapMap.cpp:11:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winbase.h:1848:49: error: declaration of C function 'LONG InterlockedDecrement(volatile LONG*)' conflicts with
../../../C++library/STLport/stlport/stl/config/_windows.h:109:42: error: previous declaration 'long int InterlockedDecrement(long int*)' here
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winbase.h:1849:53: error: declaration of C function 'LONG InterlockedExchange(volatile LONG*, LONG)' conflicts with
../../../C++library/STLport/stlport/stl/config/_windows.h:110:42: error: previous declaration 'long int InterlockedExchange(long int*, long int)' here
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winbase.h:1857:49: error: declaration of C function 'LONG InterlockedIncrement(volatile LONG*)' conflicts with
../../../C++library/STLport/stlport/stl/config/_windows.h:108:42: error: previous declaration 'long int InterlockedIncrement(long int*)' here


 

include/winbase.h:1848:49: error: declaration of C function 'LONG InterlockedDecrement(volatile LONG*)' conflicts with
_windows.h:109:42: error: previous declaration 'long int InterlockedDecrement(long int*)' here
include/winbase.h:1849:53: error: declaration of C function 'LONG InterlockedExchange(volatile LONG*, LONG)' conflicts with
_windows.h:110:42: error: previous declaration 'long int InterlockedExchange(long int*, long int)' here
nclude/winbase.h:1857:49: error: declaration of C function 'LONG InterlockedIncrement(volatile LONG*)' conflicts with
_windows.h:108:42: error: previous declaration 'long int InterlockedIncrement(long int*)' here

 

如果使用 STLPort   Mingw API 的 Windows 版本 3.12 (或更高版本),解决方法:

如果您的 STLport 是 5.2.x,只需打开文件"stlport\stl\config\user_config.h"取消注释宏 _STLP_NEW_PLATFORM_SDK。这将帮助STLport选择正确的InterlockedXXX 函数原型。

如果您的 STLport 5.1.x,您将必须:

1.修改上面的"stlport\stl\config\user_config.h"文件。
2.在文件"stlport/stl/config/_gcc.h"中,找到以下行:

# if defined (_STLP_NEW_PLATFORM_SDK)
/* For the moment the Windows SDK coming with Mingw still mimik the old platform SDK. */
# undef _STLP_NEW_PLATFORM_SDK
# endif

然后替换为:
# include <w32api.h>

# if (__W32API_MAJOR_VERSION > 3) || ((__W32API_MAJOR_VERSION = 3) && (__W32API_MINOR_VERSION >= 12))
# if !defined(_STLP_NEW_PLATFORM_SDK)
# define _STLP_NEW_PLATFORM_SDK 1
# endif
# endif

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kmblack1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值