如何在MinGW中指定包含路径?

时间:2015-02-20 02:22:11

标签: c++ path mingw

我尝试按照这篇文章的答案中的步骤:“Building Mesa for windows 7. Mesa 9.1”。但是当我运行scons.py时,我收到以下错误:

$ scons.py build=release machine=x86 platform=windows MSVC_VERSION=12.0 libgl-gdi

scons: Reading SConscript files ...

scons: warning: VC version 12.0 not installed.  C/C++ compilers are most likely not set correctly.
 Installed versions are: ['11.0']

File "C:\Users\Administrator\Downloads\Mesa-10.4.4\scons\gallium.py", line 140,
in generate
Checking for MSVC ...  yes
Checking for X11 (x11 xext xdamage xfixes glproto >= 1.4.13)... no
Checking for XCB (x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8)... no
Checking for XF86VIDMODE (xxf86vm)... no
Checking for DRM (libdrm >= 2.4.38)... no
Checking for UDEV (libudev >= 151)... no
warning: LLVM disabled: not building llvmpipe
scons: done reading SConscript files.
scons: Building targets ...
  Compiling src\gallium\targets\libgl-gdi\libgl_gdi.c ...
libgl_gdi.c
src\gallium\targets\libgl-gdi\libgl_gdi.c(37) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
scons: *** [build\windows-x86\gallium\targets\libgl-gdi\libgl_gdi.obj] Error 2
  Compiling src\gallium\state_trackers\wgl\stw_context.c ...
stw_context.c
src\gallium\state_trackers\wgl\stw_context.c(28) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
scons: *** [build\windows-x86\gallium\state_trackers\wgl\stw_context.obj] Error
2
scons: building terminated because of errors.

我安装了Visual Studio 2013,因此我将MSVC_VERSION的版本从11.0更改为12.0。我尝试添加一个新的环境变量C_INCLUDE_PATH = C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC但它不起作用。不知道如何在MinGW上工作。谢谢你的帮助。

1 个答案:

答案 0 :(得分:1)

打开&#34; VS2012工具命令提示符&#34;,chdir <src_dir>,然后运行scons。

<强>更新

从“开始”菜单运行&gt;&gt;节目&gt;&gt; Microsoft Visual Studio 2013&gt;&gt; Visual Studio工具&gt;&gt; Command Promt。

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat将会运行。它会设置INCLUDELIBLIBPATH和其他一些变量。

在此控制台窗口中运行scons