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

📄 compiling-cpp-app.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Compiling a C++ Application</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos User Guide"HREF="ecos-user-guide.html"><LINKREL="UP"TITLE="Compiler and Linker Options"HREF="compiler-and-linker-options.html"><LINKREL="PREVIOUS"TITLE="Compiler and Linker Options"HREF="compiler-and-linker-options.html"><LINKREL="NEXT"TITLE="Debugging Techniques"HREF="debugging-techniques.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos User Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="compiler-and-linker-options.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 26. Compiler and Linker Options</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="debugging-techniques.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="COMPILING-CPP-APP">Compiling a C++ Application</H1><P>The following command lines demonstrate the	  <SPANCLASS="emphasis"><ICLASS="EMPHASIS">minimum</I></SPAN> set of options required to	  compile and link an <SPANCLASS="PRODUCTNAME">eCos</SPAN> program written in C++.	</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>Remember that when this manual shows	    <BCLASS="COMMAND"><TTCLASS="REPLACEABLE"><I>TARGET-</I></TT>g++</B>	    you should use the full name of the cross compiler,	    e.g. <BCLASS="COMMAND">i386-elf-g++</B>,	    <BCLASS="COMMAND">arm-elf-g++</B>, or	    <BCLASS="COMMAND">sh-elf-g++</B>. When compiling for the	    synthetic Linux target, use the native	    <BCLASS="COMMAND">g++</B> which must have the features	    required by <SPANCLASS="PRODUCTNAME">eCos</SPAN>.</P></BLOCKQUOTE></DIV><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="REPLACEABLE"><I>TARGET-</I></TT>g++ -c  -I<TTCLASS="REPLACEABLE"><I>INSTALL_DIR</I></TT>/include -fno-rtti -fno-exceptions file.cxx$ <TTCLASS="REPLACEABLE"><I>TARGET-</I></TT>g++ -o program file.o -L<TTCLASS="REPLACEABLE"><I>INSTALL_DIR</I></TT>/lib -Ttarget.ld -nostdlib</PRE></TD></TR></TABLE><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>Certain targets may require extra options,	    for example the SPARClite architectures require the option 	    <TTCLASS="OPTION">-mcpu=sparclite</TT>. Examine the	    <TTCLASS="FILENAME"><TTCLASS="REPLACEABLE"><I>BASE_DIR</I></TT>/packages/targets</TT>	    file or <TTCLASS="FILENAME"><TTCLASS="REPLACEABLE"><I>BASE_DIR</I></TT>/examples/Makefile</TT>	    or the &#8220;Global compiler flags&#8221; option	    (CYGBLD_GLOBAL_CFLAGS) in your generated	    <SPANCLASS="PRODUCTNAME">eCos</SPAN> configuration) to see if any extra options are	    required, and if so, what they are.</P><P>The following command lines use some other options	    which are recommended because they use the	    <ICLASS="FIRSTTERM">selective linking</I> feature:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="REPLACEABLE"><I>TARGET-</I></TT>g++ -c -I<TTCLASS="REPLACEABLE"><I>INSTALL_DIR</I></TT>/include -I. -ffunction-sections -fdata-sections -fno-rtti \          -fno-exceptions -finit-priority -g -O2 file.cxx$ <TTCLASS="REPLACEABLE"><I>TARGET-</I></TT>g++ -o program file.o -W1,--gc-sections -g -O2 -L<TTCLASS="REPLACEABLE"><I>INSTALL_DIR</I></TT>/lib -Ttarget.ld  -nostdlib</PRE></TD></TR></TABLE></BLOCKQUOTE></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="compiler-and-linker-options.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-user-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="debugging-techniques.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Compiler and Linker Options</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="compiler-and-linker-options.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Debugging Techniques</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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