Note that there are some explanatory texts on larger screens.

plurals
  1. POQt Creator does not find functions inside library
    primarykey
    data
    text
    <p>I'm on Ubuntu 13.04 trying to use functions from the <a href="http://packages.ubuntu.com/search?searchon=contents&amp;keywords=gsettingsschema.h&amp;mode=exactfilename&amp;suite=raring&amp;arch=any" rel="nofollow">gsettingsschema.h library</a></p> <p>This is my .pro file</p> <pre><code>QT+=core QT-=gui TARGET=gsettings_test CONFIG+=console CONFIG-=app_bundle CONFIG+=link_pkgconfig PKGCONFIG+=gio-2.0 TEMPLATE=app SOURCES+=main.cpp </code></pre> <p>pkg-config --libs gio-2.0 reports :</p> <pre><code>-lgio-2.0 -lgobject-2.0 -lglib-2.0 </code></pre> <p>which sounds good to me.</p> <p>In my program I use both the gio/gio.h and gio/gsettingsschema.h libraries. The compiler is able to find the functions from gio.h (like g_settings_new_full()) but it is not able to find the functions from gsettingsschema.h</p> <p>I get an error like:</p> <pre><code>undefined reference to 'g_settings_schema_source_get_default()' </code></pre> <p>What's happening here?</p> <p>EDIT: Full compilation output (as reported from Qt Creator):</p> <pre><code>01:46:09: Running steps for project gsettings_test... 01:46:09: Starting: "/usr/bin/qmake" /home/alex/Qt/gsettings_test/gsettings_test.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug 01:46:09: The process "/usr/bin/qmake" exited normally. 01:46:09: Starting: "/usr/bin/make" g++ -o gsettings_test main.o -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lQt5Core -lpthread main.o: In function `gsettings_get(QString, QString)': /home/alex/Qt/build-gsettings_test-Desktop-Debug/../gsettings_test/main.cpp:17: undefined reference to `g_settings_schema_source_get_default()' /home/alex/Qt/build-gsettings_test-Desktop-Debug/../gsettings_test/main.cpp:17: undefined reference to `g_settings_schema_source_ref(_GSettingsSchemaSource*)' /home/alex/Qt/build-gsettings_test-Desktop-Debug/../gsettings_test/main.cpp:19: undefined reference to `g_settings_schema_source_lookup(_GSettingsSchemaSource*, char const*, int)' collect2: error: ld returned 1 exit status make: *** [gsettings_test] Error 1 01:46:10: The process "/usr/bin/make" exited with code 2. Error while building/deploying project gsettings_test (kit: Desktop) When executing step 'Make' 01:46:10: Elapsed time: 00:01. </code></pre> <p>Libgio exact filename:</p> <p>/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3600.0</p> <p>Helpful command:</p> <pre><code>alex@MaD-pc:~$ sudo ldconfig -v | grep gio [sudo] password for alex: /sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory /sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory /sbin/ldconfig.real: Path `/lib/i386-linux-gnu' given more than once /sbin/ldconfig.real: Path `/usr/lib/i386-linux-gnu' given more than once libgiomm-2.4.so.1 -&gt; libgiomm-2.4.so.1.3.0 libgio-2.0.so.0 -&gt; libgio-2.0.so.0.3600.0 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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