简体   繁体   English

使用64位编译器进行编译时出现奇怪的定义错误

[英]Strange define Error when compiling with 64bit compiler

I tried to use the 64bit MinGW GCC compiler to compile the enigma suite ( http://www.bytereef.org/enigma-suite.html ). 我尝试使用64位MinGW GCC编译器来编译enigma套件( http://www.bytereef.org/enigma-suite.html )。 When I use the 32bit compiler everything works fine. 当我使用32位编译器时,一切正常。 With the 64bit one I get the following error: 使用64位操作系统时,出现以下错误:

enigma\global.h|6|error: expected identifier or '(' before numeric constant|

and the line in question is: 和有关的行是:

#define H 0

Out of curiosity I changed the line to 出于好奇,我将线路更改为

#define H3 0 

and it works (of course after changing all appearances). 并且有效(当然,在更改所有外观之后)。 Can anyone explain this behavior? 谁能解释这种行为?

The MinGW 5.1 has header mingw32\\i686-w64-mingw32\\include\\winnt.h . MinGW 5.1具有标头mingw32\\i686-w64-mingw32\\include\\winnt.h It contains structure definition with line 6889: 它包含行6889的结构定义:

DWORD H : 1;

Of course, it is a problem if there is higher included header with #define H 0 . 当然,如果包含更高的包含#define H 0标头,则是一个问题。

MinGW 4.8 does not have such structure, so here it can be compiled. MinGW 4.8没有这种结构,因此可以在此处进行编译。


The simple fix is to move #include <windows.h> on top of hillclimb.c 简单的解决方法是将#include <windows.h>移至hillclimb.c顶部

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM