⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 显示和定制工程和目标文件(1).htm

📁 ADS是一种嵌入式常用开发语言
💻 HTM
📖 第 1 页 / 共 5 页
字号:
                  alt="Figure 2-3: When you build a project, the Code and Data items for each column are filled in." 
                  src="显示和定制工程和目标文件(1).files/IcwwL2_Fig3.gif" width=405 
                  align=left> </TD></TR>
              <TR>
                <TD align=middle><FONT size=1><I>Figure 2-3: When you build a 
                  project, the Code and Data items for each column are filled 
                  in.</I></FONT> </TD></TR></TBODY></TABLE>
            <P>Notice in Figure 2-3 that the window has changed a bit. The Code 
            and Data columns now contain numbers for the items that are in the 
            current project. If you were to look at a before and after 
            screenshot of the folder on your hard disk where these items are 
            stored, you would see that some new files have been generated. Let's 
            take a quick look at those items in Figure 2-4.</P>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD><IMG height=203 
                  alt="Figure 2-4: Building a project generates new files within your project folder." 
                  src="显示和定制工程和目标文件(1).files/IcwwL2_Fig4.gif" width=388 
                  align=left> </TD></TR>
              <TR>
                <TD align=middle><FONT size=1><I>Figure 2-4: Building a 
                  project generates new files within your project 
                  folder.</I></FONT> </TD></TR></TBODY></TABLE>
            <P>Notice in our example that there is a new file in the project 
            directory. This is the x86 target's output -- the application called 
            Hello World x86. Other files in this directory that exist all of the 
            time are the .mcp file -- the project file itself -- and the .c 
            source file, which contains the source code for the application. The 
            Hello World Data directory contains various other support files 
            generated by CodeWarrior. You need not be concerned with these items 
            at this time. If you are building a debug version of the target, 
            you'll see even more files, which can contain symbolic debugging 
            information. The IDE's debugger uses the symbolic information to 
            help it present tracking operations in high-level source code. These 
            details are discussed later in Lesson 5.</P>
            <P>Now that you understand how the files work together to build a 
            target, let's run the target and see what it looks like. When you 
            double-click the Hello World x86 application, the following (Figure 
            2-5) appears on the screen.</P>
            <DIV align=center>
            <CENTER>
            <TABLE cellSpacing=0 cellPadding=0 width=345 border=0>
              <TBODY>
              <TR>
                <TD width=345><IMG height=215 
                  alt='Figure 2-5: When you run the Hello World program, a window containing the words "Hello World" appears on screen.' 
                  src="显示和定制工程和目标文件(1).files/IcwwL2_Fig5.gif" width=324 
                  align=left> </TD></TR>
              <TR>
                <TD align=middle width=345><FONT size=1><I>Figure 2-5: When 
                  you run the Hello World program, a window containing the words 
                  "Hello World" appears on screen.</I></FONT> 
            </TD></TR></TBODY></TABLE></CENTER></DIV>
            <P><B><FONT size=+1>Putting It into Play</FONT></B></P>
            <P>Someday, you too may create something as lyrical and profound as 
            Hello World. Possibly, with hard work and determination, you can do 
            this by the end of the day. The source code to make this work is as 
            follows:</P>
            <BLOCKQUOTE><XMP>          <p>#include <stdio.h></XMP>
              <P></P></BLOCKQUOTE>
            <BLOCKQUOTE><XMP>          <p>void main(void) { int c; printf(&quot;Hello World on Windows!\n&quot;); c = getchar(); 
          }</XMP>
              <P></P></BLOCKQUOTE>
            <P>That's it! Who knew it could be so easy? Go on, you know you want 
            to try it, but with some sort of profound statement instead of 
            "Hello World on Windows!" Soon you'll be writing your own 
            applications that not only can display text but can also perform 
            other tasks for you. Before you know it, you'll be customizing AIBO 
            dogs! That's Lesson 4. Well, okay, not really. Lesson 4 is 
            Linking.</P>
            <P><B><FONT size=+1>What's That Other Function Doing 
            There?</FONT></B></P>
            <P>Those already seasoned in the C language might be wondering what 
            the character input&nbsp; function, getchar(), is doing here. 
            Typically, when an application completes its job, it terminates, and 
            the OS cleans up after the program. This means the Hello World 
            window disappears moments after the application finishes drawing the 
            phrase "Hello World on Windows!" So that we can admire our 
            handiwork, we put the brakes on the program by having it wait for a 
            final keystroke before it terminates.</P>
            <P>This is not a bug, but normal behavior. Honest. CodeWarrior does 
            provide an alternate library that provides the C console I/O 
            functions used here. This alternate library will not only halt the 
            application after it finishes writing to a window but will also let 
            you save the text output to a file.</P></FONT>
            <P><FONT face="Arial, Helvetica, sans-serif" color=#000000 
            size=3><B><B>Link Order</B></B><BR></FONT><BR></P><FONT 
            face="Arial, Helvetica, sans-serif" size=2>
            <P>When you build a program using multiple source files, the link 
            order is very important. After compiling your source code, you must 
            link the items in the proper order. You will use the Link Order tab 
            to determine this order. In the case of the Hello World x86 target 
            we've been working with (Figure 2-6), note that the main.c source 
            file is first on the list, with the libraries used by the program 
            following. To reach the Link Order tab, open the project and click 
            the tab. To change the order by which files are linked, you simply 
            drag items up and down the list within this window. We will discuss 
            Linking in more detail in Lesson 4.</P>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD><IMG height=345 
                  alt="Figure 2-6: Back in the Project window, clicking the Link Order tab displays a list of component files included in the current project." 
                  src="显示和定制工程和目标文件(1).files/IcwwL2_fig6.gif" width=403 
                  align=left> </TD></TR>
              <TR>
                <TD align=middle><FONT size=1><I>Figure 2-6: Back in the 
                  Project window, clicking the Link Order tab displays a list of 
                  component files included in the current project.</I></FONT> 
              </TD></TR></TBODY></TABLE>
            <P><B><FONT size=+1>Targets</FONT></B></P>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD><IMG height=348 
                  alt="Figure 2-7: The Hello World project's Target tab." 
                  src="显示和定制工程和目标文件(1).files/IcwwL2_fig8.gif" width=406 
                  align=left> </TD></TR>
              <TR>
                <TD align=middle><FONT size=1><I>Figure 2-7: The Hello World 
                  project's Target tab.</I></FONT> </TD></TR></TBODY></TABLE>
            <P>After you've chosen the files and defined their link order, you 
            must configure the target. The target is essentially the output file 
            -- in our case, the Hello World application. There are also a lot of 
            settings that must be set behind the scenes to make it possible for 
            you to hit the target. If you double-click the Hello World target in 
            the Targets Tab (Figure 2-7), you should see the dialog box shown in 
            Figure 2-8.</P>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD><IMG height=423 
                  alt="Figure 2-8: Set targeting preferences in the Settings window." 
                  src="显示和定制工程和目标文件(1).files/IcwwL2_fig9.gif" width=628 
                  align=left> </TD></TR>
              <TR>
                <TD align=middle><FONT size=1><I>Figure 2-8: Set targeting 
                  preferences in the Settings window.</I></FONT> 
            </TD></TR></TBODY></TABLE>
            <P><FONT face="Arial, Helvetica, sans-serif" color=#000000 
            size=3><B><B>Configuring Target 
            Settings</B></B><BR></FONT><BR></P><FONT 
            face="Arial, Helvetica, sans-serif" size=2>
            <P>The preferences you learned about in Lesson 1 are global settings 
            used throughout the CodeWarrior IDE. Now, let's take a look at 
            options for configuring target options. I will briefly examine the 
            most important of these options. Follow along in your copy of 
            CodeWarrior by double-clicking an item under the Target tab to bring 
            up the Settings panel.</P>
            <P>If you want a little extra guidance, move your cursor over an 
            item in the panel, right-click it, and read the pop-up help text 
            that appears.</P>
            <BLOCKQUOTE>
              <P><B>Note:</B> Some of the items listed below are specific to the 
              target we are currently viewing, in this case the Hello World 
              target. If you're using AMD's K6 or Athlon processors, some of 
              these panels may contain items that use features specific to that 
              chip. Consult the documentation for the compiler/linker that you 
              are using to ensure that you are making the best use of your 
              development environment. </P></BLOCKQUOTE>
            <P><B><FONT size=+1>Target Preferences</FONT></B></P>
            <P>Target preferences include the following items, each with its own 
            panel:
            <UL>
              <LI><B>Target Settings:</B> Choose the target's name (the name 
              that appears in the target pop-up menu), which linker(s) to use, 
              and the output directory here. 
              <LI><B>Access Paths:</B> Access paths tell CodeWarrior where to 
              search for required files that are a part of the project but not 
              necessarily project-specific (such as header files). CodeWarrior 
              will not, by default, search your entire hard disk for files. It 
              will only look where you explicitly tell it to look with access 
              paths. 
              <LI><B>Build Extras:</B> A few miscellaneous settings to improve 
              the build speed. 
              <LI><B>Runtime Settings:</B> In order to debug non-application 
              code, such as a plug-in, you must have an application assist you. 
              The application does this by calling the suspect plug-in code. 
              This panel lets you specify the host application to use in this 
              situation. This topic will be mentioned in Lesson 8. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -