读书人

当小弟我把libcurl加入#include quot;iost

发布时间: 2013-07-08 14:13:00 作者: rapoo

当我把libcurl加入#include "iostream"的时候,出现了关键字重定义
本帖最后由 u011191275 于 2013-06-30 11:26:09 编辑 难道是libcurl在c++不能用?

看到这个文件中有一个枚举:


/*
* 'bool' exists on platforms with <stdbool.h>, i.e. C99 platforms.
* On non-C99 platforms there's no bool, so define an enum for that.
* On C99 platforms 'false' and 'true' also exist. Enum uses a
* global namespace though, so use bool_false and bool_true.
*/

#ifndef HAVE_BOOL_T
typedef enum {
bool_false = 0,
bool_true = 1
} bool_;


这是错误信息:

2>c:\users\admin\desktop\curl-7.21.3\lib\setup_once.h(274): error C2628: “<unnamed-tag>”后面接“bool”是非法的(是否忘记了“;”?)
2>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xiosbase(118): error C2065: “_SH_DENYNO”: 未声明的标识符
2> c:\program files (x86)\microsoft visual studio 11.0\vc\include\xiosbase(203): 参见对正在编译的类 模板 实例化“std::_Iosb<_Dummy>”的引用
2> with
2> [
2> _Dummy=int
2> ]
========== 生成: 成功 1 个,失败 1 个,最新 0 个,跳过 0 个 ==========

Build Summary
-------------
00:20.669 - Success - DLL Debug Win32 - lib\vc6libcurl.vcxproj
00:01.311 - Failed - Debug Win32 - test_libcurl\test_libcurl.vcxproj



这样的到底要怎么改? iostream ?bool libcurl 关键字重定义
------解决方案--------------------


你 include "iostream" 是在 include curl 的头文件之前还是之后?
把它移到后面试试

读书人网 >C++

热点推荐