How to compile existing posix code for 64-bit Windows?

前端 未结 2 1241
予麋鹿
予麋鹿 2021-02-06 12:32

I\'m ok with using Cygwin or MinGW, but I need to end up with 64-bit code, not 32-bit. This is because I will be calling the DLL from 64-bit managed C#. I can\'t seem to find

2条回答
  •  醉梦人生
    2021-02-06 12:58

    The gcc docs say:

    These `-m' switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments.

    -m32 -m64 Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture.

    Note that that's going to drive you crazy, I think, if mingw really does it that way, since normally on Windows 64 long is 32 bits and long long is the 64-bit pointer-sized type.

提交回复
热议问题