确定何时在预处理器中从64位交叉编译为32位
Determining when cross compiling for 32 bit from 64-bit in preprocessor?
我使用了在c++中确定32位与64位的答案:
#ifndef AVUNA_CFG
#define AVUNA_CFG
#if _WIN32 || _WIN64
#if _WIN64
#define BIT64
#else
#define BIT32
#endif
#endif
// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define BIT64
#else
#define BIT32
#endif
#endif
#endif
然而,当将-m32
指定给GCC进行交叉编译时,这似乎不起作用,所以它总是说BIT64
。有什么定义可以用于此目的吗?
我最终使用eclipse定义,因为我有两种不同的32/64位交叉编译运行配置。好用。
相关文章:
- G++无法编译Win7,64位(MinGW.org GCC-6.3.0-1)
- 在 Slackware 14.2 64 位上使用 ACE 库编译错误
- 如何从 Linux 交叉编译到 32 位 Windows 可执行文件
- 在 64 位 Linux armv8 计算机上编译 32 位二进制文件时遇到问题
- 如何将 32 位编译二进制转换为 64 位
- 将32位和64位应用程序(具有相同代码)编译为一个EXE
- 在 64 位 Windows 上运行的 32 位应用程序是否仍然需要使用 SAFESEH 进行编译
- 在64位Debian上交叉编译32位时找不到Libpcap
- 在Java(JNI)中与Mingw C 一起编译64位静态LIB
- C2664:以 64 位编译时
- 在使用 Visual Studio 2013 64 位编译器编译的 CMake 项目中使用 ttmath
- 64位Android编译,但在运行时出现问题
- 如何使用VS2013(64位)编译Boost
- 在windows 7 64位中编译Qt 4.8.0的MySQL驱动程序
- 在64位机上编译32位matlab应用程序(c++)
- 使用64位包编译32位Qt应用程序
- 交叉编译:检查是否可以在64位机器上构建32位
- 确定何时在预处理器中从64位交叉编译为32位
- 如何为64位Windows编译WSO2 Web服务框架- c++ ?
- 是什么原因导致此缓冲区溢出警告超过64位VS2012编译环境