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

📄 16-building programs.mht

📁 这是著名的源码浏览工具(不仅仅浏览
💻 MHT
📖 第 1 页 / 共 5 页
字号:
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998515></A>Select the build target =
from the <SPAN=20
  class=3DBold>Build Target</SPAN> list.
  <P>
  <DIV><IMG=20
  =
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-16.=
gif">=20
  </DIV>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998516></A>Click the <SPAN =
class=3DBold>Start</SPAN>=20
  button to perform the build. If you need to stop the build process for =
any=20
  reason, click the <SPAN class=3DBold>Stop </SPAN>button. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998521></A>When Source-Navigator =
starts the <KBD=20
  class=3DCode>make</KBD> <A name=3Dmarker-998520></A>command, output =
from the <KBD=20
  class=3DCode>make</KBD> process is displayed. To step through the =
results, click=20
  the left or right black arrow keys in the toolbar. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998524></A>If errors appear, the build =
target=20
  needs to be modified. See <A class=3DXRef=20
  =
href=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide.ht=
ml#10160">Modifying=20
  the Build</A>.
  <P><A name=3DpgfId-998526></A>If no errors appear, the build target is =
compiled=20
  and ready to be executed. Click the <SPAN class=3DBold>Run</SPAN> =
button to=20
  execute the application.</P></LI></OL>
<H4 class=3DHeading3><A name=3DpgfId-998530></A>External build =
systems</H4>
<P class=3DBody><A name=3DpgfId-998531></A>To build using your own <KBD=20
class=3DCode>makefile</KBD>:</P>
<OL>
  <LI class=3DNumbered>
  <P class=3DBody><A name=3DpgfId-998532></A>From the <SPAN =
class=3DBold>Tools</SPAN>=20
  menu in the <SPAN class=3DBold>Symbol Browser</SPAN>, select <SPAN=20
  class=3DBold>Build</SPAN>. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998536></A>Ensure that <SPAN =
class=3DBold>Build=20
  Targets</SPAN> is set to <KBD class=3DCode>&lt;External =
Makefile&gt;</KBD>.
  <P>
  <DIV><IMG=20
  =
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-17.=
gif">=20
  </DIV>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998537></A>In the <SPAN=20
  class=3DBold>Directory</SPAN> field, select the directory containing =
the=20
  external makefile.
  <P><A name=3DpgfId-1001880></A>If you require additional flags or a =
different=20
  <KBD class=3DCode>make</KBD> program, from the <SPAN =
class=3DBold>File</SPAN>=20
  menu, select <SPAN class=3DBold>Project Preferences </SPAN>and select =
the<SPAN=20
  class=3DBold> Others</SPAN> tab. Enter the additional flags or <KBD=20
  class=3DCode>make</KBD> program into the <SPAN =
class=3DBold>Build</SPAN> field=20
  (see <A class=3DXRef=20
  =
href=3D"http://sourcenav.sourceforge.net/online-docs/userguide/customsn.h=
tml#97692">Others=20
  Tab of the Preferences Dialog</A>). </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-1001884></A>Click the <SPAN=20
  class=3DBold>Start</SPAN> button to perform the build. If you need to =
stop the=20
  build process for any reason, click the <SPAN class=3DBold>Stop =
</SPAN>button.=20
  </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998547></A>When Source-Navigator =
starts the <KBD=20
  class=3DCode>make</KBD> <A name=3Dmarker-998546></A>command, output =
from the <KBD=20
  class=3DCode>make</KBD> process is displayed. To step through the =
results, click=20
  the left or right black arrow keys in the toolbar. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998548></A>If errors appear, the =
source code needs=20
  to be modified.
  <P><A name=3DpgfId-998549></A>If no errors appear, the build target is =
compiled=20
  and ready to be executed. Click the <SPAN class=3DBold>Run</SPAN> =
button to=20
  execute the application.</P></LI></OL>
<H3 class=3DHeading2><A name=3DpgfId-998554></A><A =
name=3D10160></A>Modifying the=20
Build</H3>
<P class=3DBody><A name=3DpgfId-998555></A>If errors appear in the <SPAN =

class=3DBold>Build</SPAN> window, the source code must be modified =
before the=20
build is downloaded to the target board.</P>
<P class=3DBody><A name=3DpgfId-998557></A>Double-clicking a line with a =
compiler=20
error message activates the <SPAN class=3DBold>Editor</SPAN> <A=20
name=3Dmarker-998556></A>with the cursor positioned on the line of code =
where the=20
error appears. Right-clicking in the output window allows you to save =
the build=20
output to a file.</P>
<P class=3DBody><A name=3DpgfId-998558></A>From the <SPAN =
class=3DBold>Windows</SPAN>=20
menu, select <SPAN class=3DBold>Add View </SPAN><EM =
class=3DArrow>-&gt;</EM> <SPAN=20
class=3DBold>Build</SPAN> to add a <SPAN class=3DBold>Build</SPAN> =
window to an=20
<SPAN class=3DBold>Editor</SPAN> window.</P>
<P class=3DFigureTitle><A name=3DpgfId-998568></A>Editor-Build =
Window</P>
<DIV><IMG=20
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-18.=
gif">=20
</DIV>
<P class=3DBody><A name=3DpgfId-998572></A>To save and recompile the =
modified files,=20
press the <SPAN class=3DBold>Start </SPAN>button. The <SPAN =
class=3DBold>Fast=20
Save</SPAN> dialog box appears asking if you want to perform a fast =
save. Click=20
the <SPAN class=3DBold>Yes</SPAN> button to save the changes and =
rebuild. Click=20
the <SPAN class=3DBold>No</SPAN> button to discard changes and perform a =
rebuild.=20
Clicking the <SPAN class=3DBold>Cancel</SPAN> button closes the dialog =
without=20
rebuilding the program.</P>
<P class=3DBody><A name=3DpgfId-998576></A>When the build is completed,=20
Source-Navigator saves the executable using the name specified in the =
<SPAN=20
class=3DBold>Link Rules</SPAN> tab. If a name is not specified, the file =
name will=20
be the target name. The compiled file is saved in the build =
directory.</P>
<H4 class=3DHeading3><A name=3DpgfId-998581></A>Build types</H4>
<P class=3DBody><A name=3DpgfId-998583></A>The <A name=3Dmenus></A><SPAN =

class=3DBold>Tools</SPAN> menu in the <SPAN class=3DBold>Build</SPAN> =
window lists=20
the types of builds you can perform. Before selecting an option from =
this menu,=20
ensure that a build target has been selected.</P>
<P class=3DFigureTitle><A name=3DpgfId-998587></A>Tools Menu</P>
<DIV><IMG=20
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-19.=
gif">=20
</DIV>
<P class=3DBody><A name=3DpgfId-998588></A>Build<BR>
<P class=3DBodyHang1>Rebuilds only the modified files. This is the same =
as=20
clicking the <SPAN class=3DBold>Start</SPAN> button in the <SPAN =
class=3DBold>Build=20
Targets</SPAN> window.</P>
<P class=3DBody><A name=3DpgfId-998589></A>Force Build<BR>
<P class=3DBodyHang1>Rebuilds the modified files in the project and =
ignores=20
errors,</P>
<P class=3DBody><A name=3DpgfId-998590></A>Clean Build<BR>
<P class=3DBodyHang1>Removes the object files and executables.</P>
<P class=3DBody><A name=3DpgfId-998591></A>Export Makefile<BR>
<P class=3DBodyHang1>Saves your build target as a <KBD =
class=3DCode>makefile</KBD>=20
for external use.</P>
<H4 class=3DHeading3><A name=3DpgfId-998593></A><A =
name=3D13755></A>Debugging the=20
build target</H4>
<P class=3DBody><A name=3DpgfId-998594></A>If you selected <SPAN=20
class=3DBold>Debug</SPAN> from the <SPAN class=3DBold>Link Rules</SPAN> =
tab in the=20
<SPAN class=3DBold>Edit Target</SPAN> dialog, you will use Insight or =
another=20
debugger to debug your code.</P>
<OL>
  <LI class=3DNumbered>
  <P class=3DBody><A name=3DpgfId-998595></A>From the <SPAN =
class=3DBold>Build</SPAN>=20
  window, click the <SPAN class=3DBold>Debug </SPAN>button.
  <P><A name=3DpgfId-998596></A>The <SPAN class=3DBold>Program to =
Debug</SPAN>=20
  dialog appears.</P>
  <P class=3DFigureTitle><A name=3DpgfId-998600></A>Program to Debug =
Dialog Box</P>
  <DIV><IMG=20
  =
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-20.=
gif">=20
  </DIV>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998601></A>In the <SPAN =
class=3DBold>Program</SPAN>=20
  field, enter or select the application to debug.
  <P><A name=3DpgfId-998602></A>In the <SPAN class=3DBold>Working =
Directory</SPAN>=20
  field, enter or select the path of the project directory.</P>
  <P><A name=3DpgfId-998603></A>On UNIX, in the <SPAN =
class=3DBold>Xterm</SPAN>=20
  field, enter <KBD class=3DCode>xterm</KBD> to have a separate debugger =
output=20
  console window appear. If this field is left blank, the =
Source-Navigator=20
  output console, specified in the <SPAN class=3DBold>Others</SPAN> =
preference tab=20
  (see <A class=3DXRef=20
  =
href=3D"http://sourcenav.sourceforge.net/online-docs/userguide/customsn.h=
tml#25936">Others=20
  tab</A>), is used. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998610></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
  debug the build target.
  <P><A name=3DpgfId-998614></A>The debugger launches.</P>
  <P><A name=3DpgfId-998621></A>For more information on the debugger, =
see <A=20
  class=3DXRef=20
  =
href=3D"http://sourcenav.sourceforge.net/online-docs/userguide/debugger.h=
tml#45395">Debugger</A>=20
  or your debugger's documentation.</P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998625></A>Return to Source-Navigator =
to fix any=20
  errors and repeat the build-download-debug cycle. </P></LI></OL>
<H5 class=3DHeading4><A name=3DpgfId-998626></A>Changing the build =
target from Debug=20
to Execute</H5>
<P class=3DBody><A name=3DpgfId-998627></A>After debugging and fixing =
your build=20
target, you must change the build target from debug to execute in order =
to run=20
the application.</P>
<OL>
  <LI class=3DNumbered>
  <P class=3DBody><A name=3DpgfId-998628></A>From the <SPAN =
class=3DBold>Symbol=20
  Browser </SPAN>window, select <SPAN class=3DBold>Tools</SPAN> <EM=20
  class=3DArrow>-&gt;</EM> <SPAN class=3DBold>Build Settings</SPAN>. =
</P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998629></A>Double-click the build =
target to modify=20
  from the <SPAN class=3DBold>Build Targets</SPAN> list box. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998630></A>Click the <SPAN =
class=3DBold>Link=20
  Rules</SPAN> tab. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998631></A>In the <SPAN=20
  class=3DBold>Debug/Execute</SPAN> <SPAN class=3DBold>Settings</SPAN>, =
select <SPAN=20
  class=3DBold>Execute</SPAN>. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998632></A>Click the <SPAN =
class=3DBold>OK</SPAN>=20
  button to close the <SPAN class=3DBold>Edit Target</SPAN> dialog. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998633></A>Click the <SPAN =
class=3DBold>Done</SPAN>=20
  button to close the <SPAN class=3DBold>Build Settings</SPAN> dialog. =
</P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-998636></A>Recompile and execute your =
build target=20
  (see <A class=3DXRef=20
  =
href=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide.ht=
ml#57216">Compiling=20
  Build Targets</A>). </P></LI></OL>
<H4 class=3DHeading3><A name=3DpgfId-998640></A><A =
name=3Dmarker-998638></A><A=20
name=3D28559></A>Executing the application</H4>
<P class=3DBody><A name=3DpgfId-998642></A>Once the application compiles =
without=20
errors, from the <SPAN class=3DBold>Build</SPAN> window, click the <SPAN =

class=3DBold>Run</SPAN> button to execute the application.</P>
<H2 class=3DHeading1><A name=3DpgfId-998197></A><A =
name=3Dtutorial></A>Build=20
Tutorial</H2>
<P class=3DBody><A name=3DpgfId-1002415></A>This build tutorial is based =
on the <KBD=20
class=3DCode>monop</KBD> demo, located in the <KBD =
class=3DCode>demos</KBD>=20
directory. <KBD class=3DCode>monop</KBD> is a command line based game =
that you can=20
build, edit, and play. In this tutorial, you will create two build =
targets and=20
use many build and debugging features of Source-Navigator.</P>
<H3 class=3DLabel><A name=3DpgfId-1002419></A>Note</H3>
<P class=3DNote><A name=3DpgfId-1002420></A>The monop demo is written in =
C. A Java=20
demo is located in the <KBD class=3DCode>.../share/demos/java</KBD> =
folder. A C++=20
demo is located in the <KBD class=3DCode>.../share/demos/c++</KBD> =
folder. To=20
learn more about these demos, read the Readme file located in each =
folder.</P>
<H3 class=3DHeading2><A name=3DpgfId-1002429></A>Creating the =
Project</H3>
<OL>
  <LI class=3DNumbered>
  <P class=3DBody><A name=3DpgfId-1002431></A>In the <SPAN =
class=3DBold>Symbol=20
  Browser</SPAN>, from the <SPAN class=3DBold>File</SPAN> menu, select =
<SPAN=20
  class=3DBold>New Project</SPAN>. </P>
  <LI class=3DNumberedNext>
  <P class=3DBody><A name=3DpgfId-1002441></A>Create a new project =
called <KBD=20

⌨️ 快捷键说明

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