VC編譯最佳化設定

來源:互聯網
上載者:User

VC編譯最佳化設定

VC- Project Setting-Debug-Project Option文法解釋

-最佳化- 
/O1 最小化空間 minimize space
/Op[-] 改善浮點數一致性 improve floating-pt consistency
/O2 最大化速度 maximize speed
/Os  優選代碼空間  favor code space
/Oa 假設沒有別名 assume no aliasing
/Ot 優選代碼速度 favor code speed
/Ob 內聯展開(預設 n=0) inline expansion (default n=0)
/Ow  假設交叉函數別名  assume cross-function aliasing
/Od  禁用最佳化(預設值)  disable optimizations (default)
/Ox  最大化選項。(/Ogityb2 /Gs) maximum opts. (/Ogityb1 /Gs)
/Og  啟用全域最佳化  enable global optimization 
/Oy[-]  啟用架構指標省略  enable frame pointer omission
/Oi  啟用內建函數  enable intrinsic functions

-代碼產生- 
/G3  為 80386 進行最佳化  optimize for 80386
/G4  為 80486 進行最佳化  optimize for 80486
/GR[-]  啟用 C++ RTTI  enable C++ RTTI
/G5  為 Pentium 進行最佳化  optimize for Pentium
/G6 為 Pentium Pro 進行最佳化  optimize for Pentium Pro
/GX[-]  啟用 C++ 異常處理(與 /EHsc 相同)  enable C++ EH (same as /EHsc)
/EHs  啟用同步 C++ 異常處理  enable synchronous C++ EH
/GD 為 Windows DLL 進行最佳化 optimize for Windows DLL
/GB  為混合模型進行最佳化(預設)  optimize for blended model (default)
/EHa  啟用非同步 C++ 異常處理  enable asynchronous C++ EH
/Gd  __cdecl 呼叫慣例  __cdecl calling convention 
/EHc  extern“C”預設為 nothrow  extern "C" defaults to nothrow
/Gr  __fastcall 呼叫慣例  __fastcall calling convention
/Gi[-] 啟用增量編譯 enable incremental compilation
/Gz  __stdcall 呼叫慣例  __stdcall calling convention 
/Gm[-]  啟用最小重建  enable minimal rebuild
/GA  為 Windows 應用程式進行最佳化 optimize for Windows Application
/Gf  啟用字串池  enable string pooling 
/QIfdiv[-]  啟用 Pentium FDIV 修複  enable Pentium FDIV fix 
/GF  啟用唯讀字串池  enable read-only string pooling 
/QI0f[-]  啟用 Pentium 0x0f 修複  enable Pentium 0x0f fix
/Gy  分隔連結器函數  separate functions for linker
/GZ  啟用運行時調試檢查 enable runtime debug checks
/Gh 啟用鉤子函數調用 enable hook function call
/Ge  對所有函數強制堆棧檢查  force stack checking for all funcs
/Gs[num]  禁用堆棧檢查調用  disable stack checking calls

-輸出檔案- 
/Fa  命名程式集列表檔案  name assembly listing file
/Fo  命名物件檔案  name object file
/FA[sc]  配置程式集列表  configure assembly listing 
/Fp  命名先行編譯標頭檔  name precompiled header file
/Fd  命名 .PDB 檔案  name .PDB file 
/Fr  命名源瀏覽器檔案  name source browser file
/Fe  命名可執行檔  name executable file
/FR  命名擴充 .SBR 檔案  name extended .SBR file
/Fm  命名對應檔  name map file

-前置處理器- 
/FI  命名強制包含檔案  name forced include file
/C  不吸取注釋  don't strip comments 
/U  移除預定義宏  remove predefined macro
/D{=|#}  定義宏  define macro
/u  移除所有預定義宏  remove all predefined macros
/E  將預先處理定向到標準輸出 preprocess to stdout
/I 添加到包含檔案的搜尋路徑  add to include search path
/EP  將預先處理定向到標準輸出,不要帶行號  preprocess to stdout, no #line
/X  忽略“標準位置”  ignore "standard places"
/P  預先處理到檔案  preprocess to file

-語言- 
/Zi  啟用調試資訊  enable debugging information
/Zl  忽略 .OBJ 中的預設庫名  omit default library name in .OBJ
/ZI  啟用調試資訊的“編輯並繼續”功能 enable Edit and Continue debug info
/Zg  產生函數原型  generate function prototypes
/Z7  啟用舊式調試資訊  enable old-style debug info
/Zs  只進行語法檢查  syntax check only
/Zd  僅要行號調試資訊  line number debugging info only
/vd{0|1}  禁用/啟用 vtordisp  disable/enable vtordisp
/Zp[n]  在 n 位元組邊界上封裝結構  pack structs on n-byte boundary
/vm  指向成員的指標類型  type of pointers to members
/Za  禁用擴充(暗指 /Op)  disable extensions (implies /Op)
/noBool  禁用“bool”關鍵字  disable "bool" keyword
/Ze  啟用擴充(預設)  enable extensions (default)

- 雜項 - 
/?, /help  列印此協助訊息  print this help message
/c  只編譯,不連結  compile only, no link
/W  設定警告層級(預設 n=1)  set warning level (default n=1)
/H  最大化外部名稱長度  max external name length
/J  預設 char 類型是 unsigned  default char type is unsigned
/nologo  取消顯示著作權訊息  suppress copyright message
/WX  將警告視為錯誤  treat warnings as errors
/Tc  將檔案編譯為 .c  compile file as .c 
/Yc  建立 .PCH 檔案  create .PCH file
/Tp  將檔案編譯為 .cpp  compile file as .cpp 
/Yd  將調試資訊放在每個 .OBJ 中  put debug info in every .OBJ
/TC  將所有檔案編譯為 .c  compile all files as .c 
/TP  將所有檔案編譯為 .cpp  compile all files as .cpp 
/Yu  使用 .PCH 檔案  use .PCH file
/V  設定版本字串  set version string
/YX  自動的 .PCH 檔案 automatic .PCH
/w  禁用所有警告  disable all warnings
/Zm  最大記憶體配置(預設為 %)  max memory alloc (% of default)

-連結- 
/MD  與 MSVCRT.LIB 連結  link with MSVCRT.LIB
/MDd  與 MSVCRTD.LIB 調試庫連結  link with MSVCRTD.LIB debug lib
/ML  與 LIBC.LIB 連結  link with LIBC.LIB
/MLd  與 LIBCD.LIB 調試庫連結  link with LIBCD.LIB debug lib
/MT  與 LIBCMT.LIB 連結  link with LIBCMT.LIB 
/MTd  與 LIBCMTD.LIB 調試庫連結  link with LIBCMTD.LIB debug lib
/LD  建立 .DLL  Create .DLL 
/F  設定堆棧大小  set stack size
/LDd  建立 .DLL 調試庫  Create .DLL debug libary
/link  [連結器選項和庫]  [linker options and libraries]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.