Gcc 无法在Windows 7上编译restbed

Gcc 无法在Windows 7上编译restbed,gcc,makefile,cmake,Gcc,Makefile,Cmake,我终于完成了16个小时的配置、安装、删除、修改和多次敲击键盘 我想用在PultFrm独立的C++编程中,但我不能建立这个东西。我已经在2017/04/24安装了Cygwin下载,想想git或任何令人毛骨悚然的东西,代码::Blocks with MinGW 16.01,至少还有一个单独的MinGW也在2017/04/24安装中下载。此外,我还介绍了Visual Studio 2012 Pro、2015和2017在Windows 7 x64 Pro上的长篇故事 这是我尝试的结果: 使用git在空目

我终于完成了16个小时的配置、安装、删除、修改和多次敲击键盘

<>我想用在PultFrm独立的C++编程中,但我不能建立这个东西。我已经在2017/04/24安装了Cygwin下载,想想git或任何令人毛骨悚然的东西,代码::Blocks with MinGW 16.01,至少还有一个单独的MinGW也在2017/04/24安装中下载。此外,我还介绍了Visual Studio 2012 Pro、2015和2017在Windows 7 x64 Pro上的长篇故事

这是我尝试的结果: 使用git在空目录中递归克隆,并按照说明进行操作

cmake -DBUILD_TESTS=YES -DBUILD_EXAMPLES=YES -DBUILD_SSL=NO -DBUILD_SHARED=YES ..
嗯。。成功我似乎是使用Cygwin的gcc/g++实现的

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
:
:
-- Configuring done
-- Generating done
-- Build files have been written to: /cygdrive/d/Entwicklung/C++/restbed/restbed/build
很好!以下是:

make -j install
工作7%后,会发出一系列警告,但失败:

/cygdrive/{my_path_to}/restbed/restbed/dependency/asio/asio/include/asio/detail/config.hpp:755:5: warning: #warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. [-Wcpp]
 #   warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately.
     ^
/cygdrive/{my_path_to}/restbed/restbed/dependency/asio/asio/include/asio/detail/config.hpp:756:5: warning: #warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line. [-Wcpp]
 #   warning For example, add -D_WIN32_WINNT=0x0501 to the compiler command line.
     ^
/cygdrive/{my_path_to}/restbed/restbed/dependency/asio/asio/include/asio/detail/config.hpp:757:5: warning: #warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target). [-Wcpp]
 #   warning Assuming _WIN32_WINNT=0x0501 (i.e. Windows XP target).
     ^
/cygdrive/{my_path_to}/restbed/restbed/dependency/asio/asio/include/asio/detail/config.hpp:781:5: error: #error You must add -D__USE_W32_SOCKETS to your compiler options.
I修改config.hpp并添加

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
“define bla”警告消失了,但现在我应该设置“-D_使用W32_套接字”

但是在哪里呢

在研究google之后,我尝试设置一个环境变量CPPFLAGS=-D_uuuse_W32_SOCKETS,但这并没有改变什么

好吧,现在我想给MinGW一个机会,但我如何摆脱这个渗透剂Cygwin,而不卸载和弄乱其他软件

酷,我应该设置一些环境变量吗。。。。 清理构建目录并设置cmake输出中提到的CC和CXX

SET CC=D:/MinGW/bin/gcc.exe
SET CXX=D:/MinGW/bin/g++.exe
检查我的路径变量并添加;D:\MinGW\mysys\1.0\bin;D:\MinGW\bin

现在使用cmake bla。。再一次…但是。。。但是什么

-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
CMake Error at CMakeLists.txt:4 (project):
  The CMAKE_C_COMPILER:

    D:/MinGW/bin/gcc.exe

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:4 (project):
  The CMAKE_CXX_COMPILER:

    D:/MinGW/bin/g++.exe

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/cygdrive/{my_path_to}/restbed/restbed/build/CMakeFiles/CMakeOutput.log".
Cygwin cmake说,我在GNU5.4.0版本中使用gcc/g++。另一方面,它检测到正确的MinGW版本为5.3.0,但找不到它?胡

如何在Windows 7下使此库正常工作

编辑开始

要为代码::块构建makefile,-G参数不起作用。我尝试了一些组合,但总是说:

现在这许多被审查的词的东西想知道cmake的制作吗

我的错。。。。别想我安装了什么

CodeBlocks-Unix Makefiles在生成项目文件时按预期工作,但无法在Code::Blocks下编译。我将“构建选项”中项目的编译器更改为Cygwin,但表示:

Execution of '/usr/bin/make.exe -j8 -f "/cygdrive/d/{my_path_to}/restbed/restbed/build/Makefile"  VERBOSE=1 all' in 'D:\{my_path_to}\restbed\restbed\build' failed.
……仅此而已。我想这与Windows下的Unix Makefile有关

编辑结束

我不知道该做什么,设置什么,删除什么,修改什么,配置什么,等等

我最后的希望是,有人有大的暗示,一个好主意或解决办法


提前感谢。

Restbed可以使用构建,为什么不为该平台使用本机工具链?

根据Restbed自述,需要符合c++11的编译器。GCC 5.4.0当然与c++11兼容,因此应在MinGW环境中使用最小的cmake cmdline。您所述的故障看起来与环境无关,与项目无关。在GitHub问题跟踪器上提交一张票证,并在时间允许时到达;由于本机工具链的可用性,优先级较低。关于MinGW错误:不要设置CC或CXX或CMAKE_C_标志,CMAKE_CXX_标志。相反,让MinGW的gcc、g++在您的路径中可用;i、 e.设置路径=D:\MinGW\bin;%路径%。最重要的是,使用-GMinGW makefile调用cmake。
Execution of '/usr/bin/make.exe -j8 -f "/cygdrive/d/{my_path_to}/restbed/restbed/build/Makefile"  VERBOSE=1 all' in 'D:\{my_path_to}\restbed\restbed\build' failed.