【正文】
將這些文件編譯得到單個的輸出文件。這個問題可能只是一個輸入上的小錯誤或者只是一個變量用錯了,因此你很難發(fā)現(xiàn)它。該目標文件的源文件保持不變,但是需要預先設置置一些選項才能產(chǎn)生該程序的調試版本。這是我們在本課程中早已學到的知識。實際上, CodeWarrior 有一個特定的存取路徑,叫做 system paths, 它指向 CodeWarrior 自帶的庫和頭文件存放的目錄。 DLL 的優(yōu)點就是它能夠被共享。你可以查看 Metrowerks 的幫助頁面來獲得相關信息,因為微軟公司會為 CodeWarrior 的發(fā)行版本提供一些升級補丁。t find the one typo that39。ll create them by typing the source code into the CodeWarrior editor. In some cases, you will also use prebuilt source code and header files. There are also library files, such as the Metrowerks Standard Library (MSL) which provides valuable functions for math calculations and I/O operations. Your source code will usually be written in C or C++, but can also be in any other language that is supported by a CodeWarrior IDE plugin. Recall that CodeWarrior is an extensible IDE. In other words, by inserting (or writing) a plugin, you can extend the capabilities of the CodeWarrior IDE. For example, if someone develops a new programming language, say Z++, you could create a plugin to support that language and sell it for a zillion bucks, and then anyone using the CodeWarrior IDE could program in Z++. Understanding the Compile Phase Compiling your source code is the next step after you type it in. When you pile your source code, your puter parses and analyzes the code that you39。s done, your program will run within the debugger window, allowing you to isolate and fix any problems you find. Quite often you will generate a debug target of the program. The target39。s library changes things a bit. Libraries provided by thirdparty vendors contain several files: the library file itself (usually with a name ending in .lib), a header file (.h), and (hopefully) some documentation (.doc). The header file is required so that the piler can match function calls in your program to functions within the library. You include the header file in your source file and then simply call the library functions as if they were part of the operating system. In most cases, you place the .h and .lib files in your source path, as defined by CodeWarrior. This path is usually in the directory where your project file is located, or inside a subdirectory of this directory. Note that certain libraries CodeWarrior provides, such as its MSL, reside in a different directory from the one your project lives in. In fact, CodeWarrior has its own special access paths, called system paths, which point to the directories of its own libraries and header files. a Shared Library Thirdparty vendors ship library files with their products so that they don39。re free to call the Win32 APIs directly, it39。ll be unable to fix it yourself. You39。re good. Someone Else39。re looking at other windows of CodeWarrior. Begin using the debugger by selecting Enable Debugger from the Project menu。ve chosen an excellent place to begin your journey. Understanding the Project File To create programs in CodeWarrior, you will use a number of files that work together to form a project. A project39。 Introduction to CodeWarrior Development Tools What Will CodeWarrior Do for Me? It can be frustrating to use other people39。雖然你已經(jīng)可以自由地直接調用 Win32 APIs,但使用 MFC 會更簡單一些,因為 MFC 提供了諸如創(chuàng)建一個窗口或者使用智能默認設置和錯誤檢查代碼來編寫文件這樣的基本服務。當應用程序運行時,它會自己去找到該 DLL 并使用它的服務。這個路徑通常在你的工程 文件所在的目錄,或者其下的子目錄中。以下是幾種在編程中使用庫的方法: DLL 第一種使用庫的方法很簡單。完成上述步驟后,你的程序就會在調試窗口中運行,此時你就可以隔離并改正你找到的任何一個問題了。 四、 關于調試 調試就是在你的程序代碼中找到一個問題并著手去解決它的過程。連接確保了每片代碼都知道如何去找到你程序中的其它元素。 機器 語言 難于閱讀,不要去管它。在某些情況下,你還將使用一些預編譯的源碼和頭文件。你已經(jīng)找到了一個最優(yōu)秀的地方開始你的編程之旅。 動態(tài)鏈接庫 (DLLs) 提供了 一些很有用的被系統(tǒng)和應用程序共享的函數(shù)。你所使用過的每個應用程序都經(jīng)過了使用象 CodeWorrior 這樣的開發(fā)工