mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-21 19:54:51 +02:00
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
This commit is contained in:
parent
e930e3b3aa
commit
6b201748b5
@ -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
|
be substituted into the command line before execution. So to
|
||||||
compile a GLib Hello, World, you would type the following:
|
compile a GLib Hello, World, you would type the following:
|
||||||
<programlisting>
|
<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>
|
</programlisting>
|
||||||
</para>
|
</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>
|
<para>
|
||||||
Deprecated GLib functions are annotated to make the compiler
|
Deprecated GLib functions are annotated to make the compiler
|
||||||
|
Loading…
x
Reference in New Issue
Block a user