Reputation: 87
My specific error is when trying to run a GDBus example code from here: https://developer.gnome.org/gio/2.30/GDBusConnection.html
The error looks like this:
/usr/bin/ld: main.o: undefined reference to symbol 'g_variant_type_checked_'
//usr/lib64/libglib-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [GDbus_test] Error 1
Upvotes: 0
Views: 2459
Reputation: 87
You need to add the library to the .pro file via LIBS += ....
After trying unsuccessfully variants of "libglib-2.0", I learned that the way to get the library name from the error is to replace the "lib" with a "-l", so -lglib-2.0.
The error was solved after adding
LIBS += -lglib-2.0
as well as
\ -lgio-2.0 \
-lgobject-2.0 \
when those missing DSO errors then popped up (libgio-2.0 and libgobject-2.0)
Upvotes: 2