2016-11-15 84 views
1
gcc -m32 main.cpp 

gcc -m64 main.cpp 

gcc main.cpp 

gcc的選項中-m32,-m64nothing之間有什麼區別?-m32,-m64和gcc的選項中沒有什麼區別?

+0

您可以運行'男人gcc'找到答案,或[讀到這裏(https://gcc.gnu.org/onlinedocs /gcc/x86-Options.html)。使用的默認標誌由編譯器在構建時的配置方式確定,通常對於64位環境暗示* -m64 *。 –

回答

3

參考GCC手冊頁[here],表示

-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. 
For darwin only the -m64 option turns off the -fno-pic and -mdynamic-no-pic options. 
相關問題