所以我正在尝试在 Visual Studio 2010 中编译一个项目,但我似乎在编译代码时遇到了问题。
我有这段代码
#ifdef WIN_X64
extern "C" int gainAndFindMax (int cnt,int gain,PSHORT pInput,PSHORT pOutput);
#else
extern "C" int __fastcall gainAndFindMax (int cnt,int gain,PSHORT pInput,PSHORT pOutput);
#endif
这是同事写的一对汇编函数。 但是,出于某种原因,它一直朝着 #else 语句编译,就好像它不是在 64 位中编译一样。 我将所有项目设置都设置为 64 位,应该都正确设置了,但是由于某种原因 "extern "C"int gainAndFindMax (int cnt,int gain,PSHORT pInput,PSHORT pOutput);"显示为灰色,似乎无法编译。 非常有帮助
最佳答案
您应该查看的宏是 _WIN64
(或至少是 _M_X64
),取自 here
关于c++ - Visual Studio 似乎不认为它是在 64 位中编译的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9632065/