乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      在Windows下配置VIM,實(shí)現(xiàn)GCC G++編譯和調(diào)試

       Rainboy913 2013-12-07

       

      是在windows里面實(shí)現(xiàn)用gcc/g++編譯調(diào)試c/cpp文件:

       

      1,首先下載安裝MinGW,下載地址在http:///projects/mingw/。這個(gè)是邊下載邊安裝的,下載完成即安裝完成。我的安裝目錄是G:\MinGW。

      2,設(shè)置環(huán)境變量。右擊我的電腦,點(diǎn)屬性->高級(jí)->環(huán)境變量。然后:

      1、在PATH里加入G:\MinGW\bin,記得,如果里面還有其他的變量,記得要加個(gè)分號(hào)啊,分號(hào)得在英文輸入模式下輸入的。
      2、新建LIBRARY_PATH變量,如果有的話,在值中加入G:\MinGW\lib,這是標(biāo)準(zhǔn)庫(kù)的位置。
      3、新建C_INCLUDEDE_PATH變量,值設(shè)為G:\MinGW\include。
      4、新建CPLUS_INCLUDE_PATH變量,值為G:\MinGW\include;G:\MinGW\include\c++\4.5.0;G:\MinGW\include\c++\4.5.0\backward;G:\MinGW\include\c++\4.5.0\mingw32

      具體路徑請(qǐng)根據(jù)你的MinGW選擇。

      3,在你的_vimrc文件中配置編譯調(diào)試選項(xiàng)。我的個(gè)人配置如下:

      “定義CompileRun函數(shù),用來調(diào)用進(jìn)行編譯和運(yùn)行

      func CompileRun()
      exec “w”
      “C程序
      if &filetype == ‘c’
      exec “!gcc -Wall -enable-auto-import % -g -o %<.exe”
      “c++程序
      elseif &filetype == ‘cpp’
      exec “!g++ -Wall -enable-auto-import  % -g -o %<.exe”
      “Java程序
      elseif &filetype == ‘java’
      exec “!javac %”
      endif
      endfunc
      “結(jié)束定義CompileRun
      “定義Run函數(shù)
      func Run()
      if &filetype == ‘c’ || &filetype == ‘cpp’
      exec “!%<.exe”
      elseif &filetype == ‘java’
      exec “!java %<”
      endif
      endfunc
      “定義Debug函數(shù),用來調(diào)試程序
      func Debug()
      exec “w”
      “C程序
      if &filetype == ‘c’
      exec “!gcc % -g -o %<.exe”
      exec “!gdb %<.exe”
      elseif &filetype == ‘cpp’
      exec “!g++ % -g -o %<.exe”
      exec “!gdb %<.exe”
      “Java程序
      elseif &filetype == ‘java’
      exec “!javac %”
      exec “!jdb %<”
      endif
      endfunc
      “結(jié)束定義Debug
      “設(shè)置程序的運(yùn)行和調(diào)試的快捷鍵F5和Ctrl-F5
      map <F5> :call CompileRun()<CR>
      map <F6> :call Run()<CR>
      map <C-F5> :call Debug()<CR>

      4,完成上面幾步基本上就大功告成啦,盡情享受vim編程吧。

      可能遇到的問題:

      編譯的時(shí)候可能會(huì)出現(xiàn):

      Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-import)

      c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: a

      uto-importing has been activated without –enable-auto-import specified on the c

      ommand line.

      This should work unless it involves constant data structures referencing symbols

      from auto-imported DLLs.)

      在編譯命令中加入 -enable-auto-import 就行啦

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多