簡體   English   中英

gcc 用 32 位架構編譯不工作

[英]gcc compile with 32-bit architecture not working

我正在嘗試使用 gcc 編譯 C 文件。 header 文件中的代碼需要指定架構才能編譯。

#if defined( _8BIT_ARCHITECTURE )
 #include "type8.h"

#elif defined( _16BIT_ARCHITECTURE )
 #include "type16.h"

#elif defined( _32BIT_ARCHITECTURE )
 #include "type32.h"

#else
 #error ARCHITECTURE not defined
#endif

在使用 Visual Studio 時,我可以將平台配置為 32 位,並且可以成功構建。 但是如何使用 gcc 命令做同樣的事情?

我試圖使用:

gcc -m32 -c myFile.c -I /somePath/

但它一直給我錯誤聲明:

 #error ARCHITECTURE not defined

添加-D_32BIT_ARCHITECTURE修復問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM