wxwidgets和CodeBlocks+mingw在win7下安裝和配置

來源:互聯網
上載者:User

標籤:style   blog   c   code   http   a   

1、下載CodeBlocks

在官網下載最新版,內帶mingw的CodeBlocks。網址:http://www.codeblocks.org/downloads/26#windows

一般下載第二或第三個,要內帶mingw的。

2、安裝並且設定mingw的環境變數

傻瓜式安裝,重點是把mingw選上,並且安裝後把mingw選為預設編譯器。

添加環境變數,一定在系統變數path最前面添加:D:\Program Files (x86)\CodeBlocks\MinGW\bin;

3、wxwidgets的編譯

官網:http://www.wxwidgets.org/downloads/。選擇installer下載

安裝後,注意還要編譯!

在安裝目錄的子目錄“build\msw\”下面找到“config.gcc”檔案。用寫字板開啟。

編譯四次!其中每次大概30分鐘!

四次分別修改config.gcc檔案的內容:

第一次:動態連結程式庫 + 調試版

# What type of library to build? [0,1]
SHARED := 1

# Type of compiled binaries [debug,release]
BUILD := debug


第二次:動態連結程式庫 + 發行版

# What type of library to build? [0,1]
SHARED := 1

# Type of compiled binaries [debug,release]
BUILD := release


第三次:靜態連結庫 + 調試版

# What type of library to build? [0,1]
SHARED := 0

# Type of compiled binaries [debug,release]
BUILD := debug


第四次:靜態連結庫 + 發行版

# What type of library to build? [0,1]
SHARED := 0

# Type of compiled binaries [debug,release]
BUILD := release

另外,每次對於編碼的配置,我都是用unicode編碼,因此

# Compile Unicode build of wxWidgets? [0,1]
UNICODE := 1

這個選項始終沒改。

 

 

 

每次改完後,要用到mingw來編譯,步驟如下:

先cmd,在進入D:\wxWidgets-3.0.0\build\msw路徑(根據安裝路徑不同而不同),執行命令:mingw32-make.exe -f makefile.gcc,等30分鐘左右,編譯會完成。完成:

最後強調一次,要編譯4次。。

4、設定wxWidgets全域變數

在“Settings”->“Global Variables…”中設定

設定

5、建立項目測試

在“File”->“New”->“Project…”最後有wxWidgets項目:

一路向下,其中可以選的:

按F8編譯調試,出現錯誤:

在“Project”->“Build options”中,出錯哪些就刪除:

搞定。

6、設定codeBlocks中文

自行度娘或Google,下載漢化語言即可。 成功變身

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.