?? compiling.sgml
字號(hào):
<refentry id="glib-compiling" revision="17 Jan 2002"><refmeta><refentrytitle>Compiling GLib Applications</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>GLib Library</refmiscinfo></refmeta><refnamediv><refname>Compiling GLib Applications</refname><refpurpose>How to compile your GLib application</refpurpose></refnamediv><refsect1><title>Compiling GLib Applications on UNIX</title><para>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<application>pkg-config</application> utility.</para><para>The following interactive shell session demonstrates how<application>pkg-config</application> is used (the actual output onyour system may be different):<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 </programlisting></para><para>If your application uses threads or <structname>GObject</structname>features, it must be compiled and linked with the options returned by the following <application>pkg-config</application> invocations: <programlisting>$ pkg-config --cflags --libs gthread-2.0$ pkg-config --cflags --libs gobject-2.0</programlisting></para><para>If your application uses modules, it must be compiled and linked with the options returned by one of the following <application>pkg-config</application> invocations: <programlisting>$ pkg-config --cflags --libs gmodule-no-export-2.0 $ pkg-config --cflags --libs gmodule-2.0 </programlisting>The difference between the two is that gmodule-2.0 adds <option>--export-dynamic</option> to the linker flags, which is often not needed.</para><para>The simplest way to compile a program is to use the "backticks"feature of the shell. If you enclose a command in backticks(<emphasis>not single quotes</emphasis>), then its output will besubstituted into the command line before execution. So to compile a GLib Hello, World, you would type the following:<programlisting>$ cc `pkg-config --cflags --libs glib-2.0` hello.c -o hello</programlisting></para><para>If you want to make sure that your program doesn't use any deprecatedfunctions, you can define the preprocessor symbol G_DISABLE_DEPRECATEDby using the command line option <literal>-DG_DISABLE_DEPRECATED=1</literal>.</para></refsect1></refentry>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -