Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 0551a44115f6e0f4237e274e52a253d8 > files > 17

stdair-doc-1.00.1-4.fc18.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta name="robots" content="index,follow"/>
	<title>Linking with StdAir</title>
	<link rel="shortcut icon" href="favicon.ico">
	<link href="tabs.css" rel="stylesheet" type="text/css"/>
	<link href="stdair.css" rel="stylesheet" type="text/css"/>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
	<script type="text/javascript">
	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-24867310-1']);
	  _gaq.push(['_setDomainName', 'none']);
	  _gaq.push(['_setAllowLinker', true]);
	  _gaq.push(['_trackPageview']);
	  (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();
	</script>
	<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
  </head>
  <body>
	<div id="top"><!-- do not remove this div! -->
	  <div id="titlearea">
		<table width="100%">
		  <tbody>
			<tr style="height: 56px;">
			  <td style="padding-left: 0.5em;">
				<div id="projectname"><a href="http://stdair.sourceforge.net"><img height="45px" alt="StdAir Logo" src="stdair_logo.png"></a>
				  &#160;<span id="projectnumber">1.00.1</span>
				</div>
				<div id="projectbrief">C++ Standard Airline IT Object Library</div>
			  </td>
			  <!-- begin SOURCEFORGE_CUSTOM-->
			  <td>
				<div id="sflogo"><a href="http://stdair.sourceforge.net"><img height="45px" alt="SourceForge Logo" src="sfx_logo.png"></a></div>
			  </td>
			  <!-- end SOURCEFORGE_CUSTOM-->
			</tr>
		  </tbody>
		</table>
	  </div>
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a00014.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Linking with StdAir </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="toc"></a>
Table of Contents</h1>
<ul>
<li><a class="el" href="a00017.html#intro">Introdution</a></li>
<li><a class="el" href="a00014.html#pkgconfig">Using the pkg-config command</a></li>
<li><a class="el" href="a00014.html#stdair_config">Using the stdair-config script</a></li>
<li><a class="el" href="a00014.html#autotools">M4 macro for the GNU Autotools</a></li>
<li><a class="el" href="a00014.html#dynamiclinking">Using StdAir with dynamic linking</a></li>
</ul>
<h1><a class="anchor" id="intro"></a>
Introdution</h1>
<p>There are two convenient methods of linking your programs with the StdAir library. The first one employs the <code>`pkg-config'</code> command (see <a href="http://pkgconfig.freedesktop.org/">http://pkgconfig.freedesktop.org/</a>), whereas the second one uses <code>`stdair-config'</code> script. These methods are shortly described below.</p>
<h1><a class="anchor" id="pkgconfig"></a>
Using the pkg-config command</h1>
<p><code>`pkg-config'</code> is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler and linker options. The syntax of the <code>`pkg-config'</code> is as follows:</p>
<div class="fragment"><div class="line">pkg-config &lt;options&gt; &lt;library_name&gt;  </div>
</div><!-- fragment --><p>For instance, assuming that you need to compile an StdAir based program <code>`my_prog.cpp'</code>, you should use the following command:</p>
<div class="fragment"><div class="line">g++ `pkg-config --cflags stdair` -o my_prog my_prog.cpp \</div>
<div class="line"> `pkg-config --libs stdair`</div>
</div><!-- fragment --><p>For more information see the <code>`pkg-config'</code> man pages.</p>
<h1><a class="anchor" id="stdair_config"></a>
Using the stdair-config script</h1>
<p>StdAir provides a shell script called <code><code>stdair-config</code></code>, which is installed by default in <code>`$prefix/bin'</code> (<code>`/usr/local/bin'</code>) directory. It can be used to simplify compilation and linking of StdAir based programs. The usage of this script is quite similar to the usage of the <code>`pkg-config'</code> command.</p>
<p>Assuming that you need to compile the program <code>`my_prog</code>.cpp' you can now do that with the following command:</p>
<div class="fragment"><div class="line">g++ `stdair-config --cflags` -o my_prog my_prog.cpp `stdair-config --libs`</div>
</div><!-- fragment --><p>A list of <code>`stdair-config'</code> options can be obtained by typing:</p>
<div class="fragment"><div class="line">stdair-config --help</div>
</div><!-- fragment --><p>If the <code>`stdair-config'</code> command is not found by your shell, you should add its location <code>`$prefix/bin'</code> to the <code>PATH</code> environment variable, e.g.:</p>
<div class="fragment"><div class="line">export PATH=/usr/local/bin:$PATH</div>
</div><!-- fragment --><h1><a class="anchor" id="autotools"></a>
M4 macro for the GNU Autotools</h1>
<p>A M4 macro file is delivered with StdAir, namely `stdair.m4', which can be found in, e.g., `/usr/share/aclocal'. When used by a `configure' script, thanks to he <code>`AM_PATH_STDAIR'</code> macro (specified in the M4 macro file), the following Makefile variables are then defined:</p>
<ul>
<li><code>`STDAIR_VERSION'</code> (e.g., defined to 0.2.0)</li>
<li><code>`STDAIR_CFLAGS'</code> (e.g., defined to <code>`-I${prefix}/include'</code>)</li>
<li><code>`STDAIR_LIBS'</code> (e.g., defined to <code>`-L${prefix}/lib -lstdair'</code>)</li>
</ul>
<h1><a class="anchor" id="dynamiclinking"></a>
Using StdAir with dynamic linking</h1>
<p>When using static linking some of the library routines in StdAir are copied into your executable program. This can lead to unnecessary large executables. To avoid having too large executable files you may use dynamic linking instead. Dynamic linking means that the actual linking is performed when the program is executed. This requires that the system is able to locate the shared StdAir library file during your program execution. If you install the StdAir library using a non-standard prefix, the <code>`LD_LIBRARY_PATH'</code> environment variable might be used to inform the linker of the dynamic library location, e.g.: </p>
<div class="fragment"><div class="line">export LD_LIBRARY_PATH=&lt;StdAir installation prefix&gt;/lib:$LD_LIBRARY_PATH</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
		
		<li class="footer">Generated on Wed May 22 2013 10:51:59 for StdAir by
		  <a href="http://www.doxygen.org/index.html">
			<img class="footer" src="doxygen.png" alt="doxygen"/></a> 
		  1.8.3.1
		</li>
		<li class="footer">
		  <a href="http://sourceforge.net/projects/stdair"><img class="footer" src="http://sflogo.sourceforge.net/sflogo.php?group_id=267760&type=12&format=.png" alt="SourceForge Logo"></a>
		</li>
	  </ul>
	</div>
  </body>
</html>