GNU G++ stops compiling after including D3D12 include paths (Using VSCode)

自闭症网瘾萝莉.ら 提交于 2019-12-11 05:24:44

问题


I am trying to get VSCode to compile DS3 Code, I have heard I needed these four include paths for D3D files to compile (to include d3d12.h):

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\shared
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\winrt
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\cppwinrt

Source: I can't configure include paths in VSCode for D3D12

So I did include them but now a simple file including windows.h does not compile any more.

The only thing in my only cpp is :

#define UNICODE // Necessary to use long chars in windows 
#define _UNICODE

#define WIN32_LEAN_AND_MEAN

// include the basic windows header file
#include <windows.h>

Here is my vs code task and g++ command line:

 "command": "${env:Cygwin64BinPath}/g++.exe",
    "args": 
    [
        "-g", 
        "-o", "MassiveSteering", 
        "*.cpp", 
        "-D_DEBUG",
        "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/shared",
        "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/um",
        "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/winrt",
        "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/cppwinrt"
    ],

I get this in the console:

Executing task: C:\cygwin64\bin/g++.exe -g -o MassiveSteering *.cpp -D_DEBUG '-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/shared' '-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/um' '-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/winrt' '-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/cppwinrt' <

In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/shared/minwindef.h:182:0,

from C:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/shared/windef.h:24,

from C:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/um/windows.h:171,

from main.cpp:7:

C:/Program Files (x86)/Windows Kits/10/Include/10.0.17134.0/um/winnt.h:154:2: error: #error "No Target Architecture"

error "No Target Architecture"

If I remove the four include paths I get no errors. Something tells me that is not what I need to add to include d3d12.h

来源:https://stackoverflow.com/questions/52431353/gnu-g-stops-compiling-after-including-d3d12-include-paths-using-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!