📄 16-building programs.mht
字号:
class=3DCode>monop.proj</KBD>. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002434></A>Under <SPAN =
class=3DBold>Add=20
Directory</SPAN>, click the "<SPAN class=3DBold>...</SPAN>" button to =
select the=20
<KBD class=3DCode>demos/monop</KBD> folder.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-21.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002590></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
create the project </P></LI></OL>
<H3 class=3DHeading2><A name=3DpgfId-1002442></A>Creating the monop =
Target</H3>
<OL>
<LI class=3DNumbered>
<P class=3DBody><A name=3DpgfId-1002443></A>From the <SPAN =
class=3DBold>Tools</SPAN>=20
menu, select <SPAN class=3DBold>Build Settings. </SPAN>The <SPAN=20
class=3DBold>Build Settings</SPAN> dialog opens. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002446></A>Enter <KBD =
class=3DCode>monop</KBD> as=20
the name of the build target.=20
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-22.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002447></A>Click the <SPAN =
class=3DBold>Create=20
</SPAN>button. The <SPAN class=3DBold>Edit Target</SPAN> dialog opens.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-23.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002448></A>In the <SPAN =
class=3DBold>Build=20
Directory</SPAN> field, click the "<SPAN class=3DBold>...</SPAN>" =
button and=20
select the build directory for the <KBD class=3DCode>monop</KBD> =
project.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-24.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002449></A>From <SPAN =
class=3DBold>Project=20
Files</SPAN>, select the <KBD class=3DCode>cards.c</KBD>, <KBD=20
class=3DCode>execute.c</KBD>, <KBD class=3DCode>getinp.c</KBD>, <KBD=20
class=3DCode>houses.c</KBD>, <KBD class=3DCode>jail.c</KBD>, <KBD=20
class=3DCode>misc.c</KBD>, <KBD class=3DCode>monop.c</KBD>, <KBD=20
class=3DCode>morg.c</KBD>, <KBD class=3DCode>print.c</KBD>, <KBD=20
class=3DCode>prop.c</KBD>, <KBD class=3DCode>rent.c</KBD>, <KBD=20
class=3DCode>roll.c</KBD>, <KBD class=3DCode>spec.c</KBD>, and <KBD=20
class=3DCode>trade.c</KBD> files. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002450></A>Click the <SPAN =
class=3DBold>Add=20
Files</SPAN> button to copy the files to the <SPAN class=3DBold>Target =
Files</SPAN> list.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-25.=
gif">=20
</DIV></LI></OL>
<H3 class=3DLabel><A name=3DpgfId-1002513></A>Note</H3>
<P class=3DNote><A name=3DpgfId-1002514></A>To execute the program =
correctly in=20
UNIX, click the <SPAN class=3DBold>Link Rules</SPAN> tab. Enter <KBD=20
class=3DCode>xterm -e ./monop</KBD> in the <SPAN class=3DBold>Command to =
launch=20
Application</SPAN> field. Click <SPAN class=3DBold>OK</SPAN> to close =
the <SPAN=20
class=3DBold>Link Rules</SPAN> dialog.</P>
<OL start=3D7>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002451></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
close the <SPAN class=3DBold>Edit Target</SPAN> dialog. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002455></A>Click the <SPAN =
class=3DBold>Done</SPAN>=20
button to close the <SPAN class=3DBold>Build Settings</SPAN> dialog.=20
</P></LI></OL>
<P class=3DBody><A name=3DpgfId-1002456></A>The build target is created. =
Now you=20
need to compile the program.</P>
<H4 class=3DHeading3><A name=3DpgfId-1002457></A>Debugging the monop =
build=20
target</H4>
<OL>
<LI class=3DNumbered>
<P class=3DBody><A name=3DpgfId-1002518></A>From the <SPAN =
class=3DBold>Tools</SPAN>=20
menu, select <SPAN class=3DBold>Build</SPAN>. The <SPAN =
class=3DBold>Build</SPAN>=20
dialog opens. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002521></A>From the <SPAN =
class=3DBold>Build=20
Targets</SPAN> field, select <KBD class=3DCode>monop</KBD>.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-26.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002522></A>Click the <SPAN=20
class=3DBold>Start</SPAN> button.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-27.=
gif">=20
</DIV><A name=3DpgfId-1002524></A>Source-Navigator generates some =
errors from=20
the build. The <KBD class=3DCode>lint</KBD> macro must be =
defined.</LI></OL>
<H4 class=3DHeading3><A name=3DpgfId-1002523></A>Creating the lint =
macro</H4>
<OL>
<LI class=3DNumbered>
<P class=3DBody><A name=3DpgfId-1002528></A>From the <SPAN =
class=3DBold>Tools</SPAN>=20
menu, select <SPAN class=3DBold>Build Settings</SPAN>. The <SPAN=20
class=3DBold>Build Settings</SPAN> dialog appears. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002529></A>Double-click the <KBD=20
class=3DCode>monop</KBD> build target. The <SPAN class=3DBold>Edit =
Target</SPAN>=20
dialog opens. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002532></A>Click the <SPAN =
class=3DBold>Build=20
Rules</SPAN> tab.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-28.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002533></A>Because <KBD =
class=3DCode>monop</KBD> is=20
written in C, double-click the <SPAN class=3DBold>C</SPAN> rule. The =
<SPAN=20
class=3DBold>Build Rule Settings</SPAN> dialog opens. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002534></A>Click the <SPAN=20
class=3DBold>Defines</SPAN> tab. Enter <KBD class=3DCode>lint</KBD> in =
the text=20
entry box.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-29.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002535></A>Click the <SPAN =
class=3DBold>New</SPAN>=20
button to create the macro. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002536></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
close the <SPAN class=3DBold>Build Rules Settings</SPAN> dialog. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002992></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
close the <SPAN class=3DBold>Edit Target</SPAN> dialog. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002993></A>Click the <SPAN =
class=3DBold>Done</SPAN>=20
button to close the <SPAN class=3DBold>Build Settings</SPAN> dialog.=20
</P></LI></OL>
<H4 class=3DHeading3><A name=3DpgfId-1002537></A>Rebuilding the monop =
build=20
target</H4>
<OL>
<LI class=3DNumbered>
<P class=3DBody><A name=3DpgfId-1002539></A>From the <SPAN =
class=3DBold>Tools</SPAN>=20
menu, select <SPAN class=3DBold>Build</SPAN>. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002538></A>From the <SPAN =
class=3DBold>Build=20
Targets</SPAN> field, select <KBD class=3DCode>monop</KBD>. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002542></A>Click the <SPAN=20
class=3DBold>Start</SPAN> button.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-30.=
gif">=20
</DIV><A name=3DpgfId-1002548></A>Source-Navigator generates without =
errors.=20
However, at runtime the program will not execute because the path to =
the cards=20
must be defined.</LI></OL>
<H4 class=3DHeading3><A name=3DpgfId-1002543></A>Creating the =
_PATH_CARDS macro</H4>
<OL>
<LI class=3DNumbered>
<P class=3DBody><A name=3DpgfId-1002643></A>From the <SPAN =
class=3DBold>Tools</SPAN>=20
menu, select <SPAN class=3DBold>Build Settings</SPAN>. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002644></A>Double-click the <KBD=20
class=3DCode>monop</KBD> build target. The <SPAN class=3DBold>Edit =
Target</SPAN>=20
dialog opens. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002648></A>Click the <SPAN =
class=3DBold>Build=20
Rules</SPAN> tab.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-31.=
gif">=20
</DIV>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002649></A>Double-click the <SPAN=20
class=3DBold>C</SPAN> rule. The <SPAN class=3DBold>Build Rule =
Settings</SPAN>=20
dialog opens. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002653></A>Click the <SPAN=20
class=3DBold>Defines</SPAN> tab. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002664></A>Enter the following =
information in the=20
text entry box, replacing <KBD class=3DCodeVariant><project=20
directory></KBD> with the path to the <KBD =
class=3DCode>demos/monop</KBD>=20
directory:
<P><A name=3DpgfId-1002667></A><KBD =
class=3DCode>_PATH_CARDS=3D"\"</KBD> <KBD=20
class=3DCodeVariant><project directory></KBD> <KBD=20
class=3DCode>/cards.pck\""</KBD> </P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-32.=
gif">=20
</DIV>
<P class=3DBody><A name=3DpgfId-1002679></A>This tells =
Source-Navigator which card=20
pack to use when running the <KBD class=3DCode>monop</KBD> =
program.</P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002654></A>Click the <SPAN =
class=3DBold>New</SPAN>=20
button to create the macro. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002655></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
close the <SPAN class=3DBold>Build Rules Settings</SPAN> dialog. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002998></A>Click <SPAN =
class=3DBold>OK</SPAN> to=20
close the <SPAN class=3DBold>Edit Target</SPAN> dialog. </P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002999></A>Click the <SPAN =
class=3DBold>Done</SPAN>=20
button to close the <SPAN class=3DBold>Build Settings</SPAN> dialog.=20
</P></LI></OL>
<H4 class=3DHeading3><A name=3DpgfId-1002680></A>Performing a clean =
build</H4>
<P class=3DBody><A name=3DpgfId-1002681></A>To ensure that the new macro =
is picked=20
up at compile time, perform a clean build on the <KBD =
class=3DCode>monop</KBD>=20
target.</P>
<OL>
<LI class=3DNumbered>
<P class=3DBody><A name=3DpgfId-1002686></A>In the <SPAN =
class=3DBold>Build</SPAN>=20
window, from the <SPAN class=3DBold>Tools</SPAN> menu, select <SPAN=20
class=3DBold>Clean Build</SPAN>.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-33.=
gif">=20
</DIV>
<P class=3DBody><A name=3DpgfId-1002691></A>A clean build is =
equivalent to the=20
command <KBD class=3DCode>make clean</KBD>.</P>
<LI class=3DNumberedNext>
<P class=3DBody><A name=3DpgfId-1002692></A>Click the <SPAN=20
class=3DBold>Start</SPAN> button to perform the build.
<P>
<DIV><IMG=20
=
src=3D"http://sourcenav.sourceforge.net/online-docs/userguide/progide-34.=
gif">=20
</DIV>
<P class=3DBody><A name=3DpgfId-1002693></A>Again <KBD =
class=3DCode>monop</KBD>=20
compiles without errors, but now it links to the correct card=20
pack.</P></LI></OL>
<P class=3DBody><A name=3DpgfId-1002728></A>Now you need to create =
another target to=20
initialize the cards used in the <KBD class=3DCode>monop</KBD> game.</P>
<H3 class=3DHeading2><A name=3DpgfId-1002641></A>Creating the initdeck =
Target</H3>
<OL>
<LI class=3DNumbered>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -