I've tried to use libqmi but I can't get through the linker. It keeps saying "undefined reference" on libqmi functions. Any suggestions what is needed?
Paths and libraries are available for gcc, the symbols are inside libqmi-glib, looks like everything is in place.
The code is the simplest possible, I think.
int main(int argc, char **argv)
{
GFile *qmi = g_file_new_for_path("/dev/cdc-wdm0");
printf("%li\r\n", (long int)(qmi));
g_object_unref(qmi);
return 0;
}
And the build goes like this:
gcc -I/usr/local/include/libqmi-glib/ -I/usr/include/glib-2.0/ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ whatever.c -L/usr/local/lib/ -L/usr/lib/x86_64-linux-gnu/ -lqmi-glib -lglib-2.0
You're missing the link to
libgobject-2
andlibgio-2
.Anyway, the best way to compile a program using libqmi is to use pkg-config as that knows all the cflags and ldflags you should be using; e.g. you could probably do this, assuming you installed libqmi in /usr/local: