我正在尝试使用gcc在Windows中编译RetroArch,但是在编译过程中出现错误:
In file included from gfx/drivers/d3d10.c:39:
gfx/drivers/../common/d3d10_common.h:1121:8: error: expected declaration specifiers or ‘...’ before ‘(’ token
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^
gfx/drivers/../common/d3d10_common.h:1121:44: error: expected declaration specifiers or ‘...’ before string constant
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gfx/common/d3d10_common.c:20:
gfx/common/d3d10_common.h:1121:8: error: expected declaration specifiers or ‘...’ before ‘(’ token
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^
gfx/common/d3d10_common.h:1121:44: error: expected declaration specifiers or ‘...’ before string constant
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:213: obj-unix/release/gfx/drivers/d3d10.o] Error 1
make: *** Se espera a que terminen otras tareas....
make: *** [Makefile:213: obj-unix/release/gfx/common/d3d10_common.o] Error 1
In file included from gfx/drivers_font/d3d10_font.c:26:
gfx/drivers_font/../common/d3d10_common.h:1121:8: error: expected declaration specifiers or ‘...’ before ‘(’ token
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^
gfx/drivers_font/../common/d3d10_common.h:1121:44: error: expected declaration specifiers or ‘...’ before string constant
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:213: obj-unix/release/gfx/drivers_font/d3d10_font.o] Error 1
In file included from menu/drivers_display/menu_display_d3d10.c:29:
/home/<user>/retroarch/gfx/common/d3d10_common.h:1121:8: error: expected declaration specifiers or ‘...’ before ‘(’ token
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^
/home/<user>/retroarch/gfx/common/d3d10_common.h:1121:44: error: expected declaration specifiers or ‘...’ before string constant
1121 | (!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:213: obj-unix/release/menu/drivers_display/menu_display_d3d10.o] Error 1
我是用C ++发起的,我不知道如何解决它,我试图在语句前后添加“&”符号,但这给了我另一个错误。 这是给我带来错误的代码:
(!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
环绕代码:
#ifndef ALIGN
#ifdef _MSC_VER
#define ALIGN(x) __declspec(align(x))
#else
#define ALIGN(x) __attribute__((aligned(x)))
#endif
#endif
typedef struct ALIGN(16)
{
math_matrix_4x4 mvp;
struct
{
float width;
float height;
} OutputSize;
float time;
} d3d10_uniform_t;
static_assert(
(!(sizeof(d3d10_uniform_t) & 0xF)), "sizeof(d3d10_uniform_t) must be a multiple of 16");
typedef struct d3d10_shader_t
{
D3D10VertexShader vs;
D3D10PixelShader ps;
D3D10GeometryShader gs;
D3D10InputLayout layout;
} d3d10_shader_t;
typedef struct
{
unsigned cur_mon_id;
DXGISwapChain swapChain;
D3D10Device device;
D3D10RasterizerState state;
D3D10RenderTargetView renderTargetView;
D3D10Buffer ubo;
d3d10_uniform_t ubo_values;
D3D10SamplerState samplers[RARCH_FILTER_MAX][RARCH_WRAP_MAX];
D3D10BlendState blend_enable;
D3D10BlendState blend_disable;
D3D10BlendState blend_pipeline;
D3D10Buffer menu_pipeline_vbo;
math_matrix_4x4 mvp, mvp_no_rot;
struct video_viewport vp;
D3D10_VIEWPORT viewport;
DXGI_FORMAT format;
float clearcolor[4];
bool vsync;
bool resize_chain;
bool keep_aspect;
bool resize_viewport;
bool resize_render_targets;
bool init_history;
d3d10_shader_t shaders[GFX_MAX_SHADERS];
#ifdef __WINRT__
DXGIFactory2 factory;
#else
DXGIFactory factory;
#endif
DXGIAdapter adapter;
文件下载: https://mega.nz/#!5vxUkYYS!jolCYJd_qwxxdZ5F0jFCaG-l2an-iX5pd0LnhCAlNXo 有人知道如何解决吗? 谢谢。