summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSebastian Geiger <sbastig@gmx.net>2012-08-09 23:01:29 +0200
committerJavier Jardón <jjardon@gnome.org>2012-08-15 02:34:50 +0900
commit6b201748b5f71f74af02ba8c01fd4c53750f910a (patch)
treeddc5366f8d3fb89c27a79248534b0f94847e79f8 /docs
parente930e3b3aac2fe4d62996d8033121a40153f2da3 (diff)
downloadglib-6b201748b5f71f74af02ba8c01fd4c53750f910a.tar.gz
compiling.xml: Add note and fix gcc example
Because of the '--as-needed' default option for the linker, the linking will fail, if the file name appears after any of the options or the pkg-config invocation. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681854
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/glib/compiling.xml7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/reference/glib/compiling.xml b/docs/reference/glib/compiling.xml
index 9add70be4..6a8626488 100644
--- a/docs/reference/glib/compiling.xml
+++ b/docs/reference/glib/compiling.xml
@@ -66,9 +66,14 @@ feature of the shell. If you enclose a command in backticks
be substituted 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
+$ cc hello.c `pkg-config --cflags --libs glib-2.0` -o hello
</programlisting>
</para>
+<note><para>
+Note that the name of the file must come before the other options
+(such as <emphasis>pkg-config</emphasis>), or else you may get an
+error from the linker.
+</para></note>
<para>
Deprecated GLib functions are annotated to make the compiler