403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/gtk-doc/html/glib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/gtk-doc/html/glib/glib-compiling.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compiling GLib Applications</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib.html" title="GLib Overview">
<link rel="prev" href="glib-cross-compiling.html" title="Cross-compiling the GLib package">
<link rel="next" href="glib-running.html" title="Running GLib Applications">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
<link rel="index" href="ix12.html" title="Index of new symbols in 2.20">
<link rel="index" href="ix13.html" title="Index of new symbols in 2.22">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="glib-cross-compiling.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-running.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry" title="Compiling GLib Applications">
<a name="glib-compiling"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Compiling GLib Applications</span></h2>
<p>Compiling GLib Applications — 
How to compile your GLib application
</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Compiling GLib Applications on UNIX">
<a name="id345657"></a><h2>Compiling GLib Applications on UNIX</h2>
<p>
To compile a GLib application, you need to tell the compiler where to 
find the GLib header files and libraries. This is done with the
<span class="application">pkg-config</span> utility.
</p>
<p>
The following interactive shell session demonstrates how
<span class="application">pkg-config</span> is used (the actual output on
your system may be different):
</p>
<pre class="programlisting">
$ pkg-config --cflags glib-2.0
 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 
$ pkg-config --libs glib-2.0
 -L/usr/lib -lm -lglib-2.0  
</pre>
<p>
</p>
<p>
If your application uses threads or <span class="structname">GObject</span>
features, it must be compiled and linked with the options returned by the 
following <span class="application">pkg-config</span> invocations: 
</p>
<pre class="programlisting">
$ pkg-config --cflags --libs gthread-2.0
$ pkg-config --cflags --libs gobject-2.0
</pre>
<p>
</p>
<p>
If your application uses modules, it must be compiled and linked with the options 
returned by one of the following <span class="application">pkg-config</span> invocations: 
</p>
<pre class="programlisting">
$ pkg-config --cflags --libs gmodule-no-export-2.0 
$ pkg-config --cflags --libs gmodule-2.0 
</pre>
<p>
The difference between the two is that gmodule-2.0 adds <code class="option">--export-dynamic</code> 
to the linker flags, which is often not needed.
</p>
<p>
The simplest way to compile a program is to use the "backticks"
feature of the shell. If you enclose a command in backticks
(<span class="emphasis"><em>not single quotes</em></span>), then its output will be
substituted into the command line before execution. So to compile 
a GLib Hello, World, you would type the following:
</p>
<pre class="programlisting">
$ cc `pkg-config --cflags --libs glib-2.0` hello.c -o hello
</pre>
<p>
</p>
<p>
If you want to make sure that your program doesn't use any deprecated
functions, you can define the preprocessor symbol G_DISABLE_DEPRECATED
by using the command line option <code class="literal">-DG_DISABLE_DEPRECATED=1</code>.
</p>
<p>
The recommended way of using GLib has always been to only include the 
toplevel headers <code class="filename">glib.h</code>, 
<code class="filename">glib-object.h</code>, <code class="filename">gio.h</code>.
Starting with 2.17, GLib enforces this by generating an error
when individual headers are directly included. To help with the 
transition, the enforcement is not turned on by default for GLib 
headers (it <span class="emphasis"><em>is</em></span> turned on for GObject and GIO).
To turn it on, define the preprocessor symbol G_DISABLE_SINGLE_INCLUDES
by using the command line option <code class="literal">-DG_DISABLE_SINGLE_INCLUDES</code>.
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit