Vista中快速搭建C++基本編程環境

Windows Vista中快速搭建C++基本編程環境

這種環境對於平時學習或編寫小C/C++程序員來說足以。

            1步:下載軟件     

            2步:安裝軟件

            3步:基本配置

            4步:調測運行

            5步:單步調測

 

1步:挑選軟件,這裏選最常用免費編程工具DEVCPP4.9.9.2)(can be downloaded from www.bloodshed.net)

 

2步:安裝提示一步步完成安裝

 

3步:基本配置

程序安裝完成後,安裝程序會自己啓動配置程序。

注:是否選擇XP Theme風格(因爲我使用的是Vista,所以,我沒有選取,但後期可以再更改)。

 

4步:編程調測

 

Editing one simple program like ‘hello.c’ and Compiling it, one error happened with message ‘studio.h No such file or directory’.

 

#include <studio.h>

int main(void)
{
  int i;
  for( i=1; i <= 10; ++i)
  {
    printf("Hello!");
  }
 
  getchar();
  return 0;
}

Why there happened this error? When I found that ‘studio.h’ can’t be found on my local computer at all, while there are ‘io.h’ and ‘stdio.h’ files, then I came true I included the wrong Head file. Once rectified it by 'stdio.h', ‘hello.c’ was complied to create 'hello.exe'.

It’s obvious that you need to know what files have been installed on your computer under DEVCPP path:

            /bin 可執行程序(殼)

            /include 頭文件 (c++ Head files have been placed under sub-path ‘/c++/3.4.2/’)

            /usr (真實的)可執行程序

            /lib

If you couldn’t make sure weather the Head files you have included are right or not or what Head files you should include, you can check it under ‘lib’ path directly.

 

5步:單步調測

單步調測對於程序員診斷問題,完成代碼非常重要。

Firstly, we should enable ‘Generate debugging information’ in Tools -> Complier Options -> Settings -> Linker menu.

 

Then you can get into Debug process activated by clicking F8, and clicking F7 step by step ensures we could test every change or affection along with each line of our code.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章