Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I build a "hello world" for glib?
    text
    copied!<p>So here's the world's simplest glib program:</p> <pre><code>#include &lt;glib.h&gt; </code></pre> <p>I try to compile it with <code>gcc test.c</code> and I get:</p> <pre><code>test.c:1:18: error: glib.h: No such file or directory </code></pre> <p>So I make sure that I have the right packages:</p> <pre><code># dpkg -l | grep libglib ii libglib-perl 1:1.183-1 Perl interface to the GLib and GObject libra ii libglib1.2-dev 1.2.10-19build1 The GLib library of C routines (development) ii libglib1.2ldbl 1.2.10-19build1 The GLib library of C routines ii libglib2.0-0 2.20.1-0ubuntu2 The GLib library of C routines ii libglib2.0-cil 2.12.1-1ubuntu2 CLI binding for the GLib utility library 2.1 ii libglib2.0-data 2.18.2-0ubuntu2 Common files for GLib library ii libglib2.0-dev 2.20.1-0ubuntu2 Development files for the GLib library ii libglibmm-2.4-1c2a 2.18.1-1 C++ wrapper for the GLib toolkit (shared lib </code></pre> <p>Then I search for any "glib.h" anywhere under /usr/include. I get two, /usr/include/glib-1.2/glib.h and /usr/include/glib-2.0/glib.h. So I try:</p> <pre><code>$ gcc -I/usr/include/glib-2.0 -Wall test.c In file included from /usr/include/glib-2.0/glib/galloca.h:34, from /usr/include/glib-2.0/glib.h:32, from test.c:2: /usr/include/glib-2.0/glib/gtypes.h:34:24: error: glibconfig.h: No such file or directory </code></pre> <p>(about 10,000 more errors snipped)</p> <p>I don't seem to have a <code>glibconfig.h</code> anywhere on my computer.</p> <p>What do I do now?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload