使用 Visual Studio 编译 libcurl(bool undefined)
Compiling libcurl with Visual Studio (bool undefined)
我想在Visual Studio项目中编译源代码的curl。
我收到此错误(以及更多):
curlsrctool_sdecls.h(67): error C2061: Syntax Error: Identifier'bool' (......frameworklibscurlsrctool_cb_dbg.c)
curlsrctool_sdecls.h(68): error C2061: Syntax Error: Identifier'bool'is_cd_filename' (......frameworklibscurlsrctool_cb_dbg.c)
curlsrctool_sdecls.h(68): error C2059: Syntax Error: ';' (......frameworklibscurlsrctool_cb_dbg.c)
此文件的来源是:
65: struct OutStruct {
66: char *filename;
67: bool alloc_filename;
68: bool is_cd_filename;
69: bool s_isreg;
...
由于某种原因,似乎没有定义bool
。我尝试定义HAVE_BOOL_T
但没有任何变化。
知道吗?谢谢
为了解决这个问题,我添加了以下内容curl_config.h
//for undefined bool error
#if _MSC_VER > 1700
#include <stdbool.h>
#else
#ifndef bool
typedef int bool;
#define false 0
#define true 1
#endif
#endif
//for warning C4005: 'POLLIN' : macro redefinition error
#define _WIN32_WINNT 0x0501
相关文章:
- 写入向量<向量<bool>>
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- Visual Studio Code "undefined reference to `WinMain@16'"
- 使用 MATLAB 编码器生成C++代码:编译错误"undefined reference to `rgb2gray_tbb_real64'"
- "Undefined class"作为is_base_of的论据
- 为什么创建友元类的实例会导致"undefined reference to"错误?
- 让bool方法返回其他整数
- Tensorflow c++ api undefined reference to 'tflite::D efaultErrorReporter()'
- 如何在 std::vector 中找到<bool>哪些索引是真的?
- Arduino-C++ bool 不会从 false 变为 true
- 为什么在这种情况下,bool 类型的输出等于 0?
- 显式 std::exception_ptr 转换为 bool 不存在.VS2010 错误?
- 错误:不能使用"显式"说明符声明 bool'
- 为什么 C++ 11 在 ios 类中添加了运算符 bool
- VSCode C/C++ Intellisense issue: Undefined identifiers (Linu
- 与卡特琳娜一起卷曲C++失败并得到"Undefined symbols for architecture x86_64"
- 从标准::字符串到标准::矢量<bool>的快速转换
- 为什么 bool 和 _Bool 如果它们在内存中占用 1 个字节,它们只能存储 0 或 1
- 通过 mpi 发送 c++ 标准::矢量<bool>
- 使用 Visual Studio 编译 libcurl(bool undefined)