undefined reference on make

Aleksander Morgado aleksander at aleksander.es
Wed Apr 11 21:56:56 UTC 2018


>
> In building libqmi-glib, I get these two undefined reference errors.  Should
> I be including a specific header file that isn't included somewhere?
>
> Full disclosure, I'm attempting to build for raspberry pi
> (arm-linux-gnueabihf).
>
> Making all in .
> make[4]: Entering directory
> '/home/pi/Downloads/libqmi-1.20.0/src/libqmi-glib'
>   CC       libqmi_glib_la-qmi-enums-wds.lo
>   CC       libqmi_glib_la-qmi-enums-dms.lo
>   CC       libqmi_glib_la-qmi-utils.lo
>   CC       libqmi_glib_la-qmi-compat.lo
>   CC       libqmi_glib_la-qmi-message.lo
>   CC       libqmi_glib_la-qmi-message-context.lo
>   CC       libqmi_glib_la-qmi-device.lo
>   CC       libqmi_glib_la-qmi-client.lo
>   CC       libqmi_glib_la-qmi-proxy.lo
>   CCLD     libqmi-glib.la
> make[4]: Leaving directory
> '/home/pi/Downloads/libqmi-1.20.0/src/libqmi-glib'
> Making all in test
> make[4]: Entering directory
> '/home/pi/Downloads/libqmi-1.20.0/src/libqmi-glib/test'
>   CC       test_utils-test-utils.o
>   CCLD     test-utils
> ../../../src/libqmi-glib/.libs/libqmi-glib.so: undefined reference to
> `mbim_message_qmi_msg_set_new'
> ../../../src/libqmi-glib/.libs/libqmi-glib.so: undefined reference to
> `mbim_message_response_get_result'
> collect2: error: ld returned 1 exit status
> Makefile:448: recipe for target 'test-utils' failed
> make[4]: *** [test-utils] Error 1
> make[4]: Leaving directory
> '/home/pi/Downloads/libqmi-1.20.0/src/libqmi-glib/test'
> Makefile:689: recipe for target 'all-recursive' failed
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory
> '/home/pi/Downloads/libqmi-1.20.0/src/libqmi-glib'
> Makefile:378: recipe for target 'all-recursive' failed
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory '/home/pi/Downloads/libqmi-1.20.0/src'
> Makefile:434: recipe for target 'all-recursive' failed
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory '/home/pi/Downloads/libqmi-1.20.0'
> Makefile:366: recipe for target 'all' failed
> make: *** [all] Error 2
>

Did you also build libmbim before trying to build libqmi?
Did you install libmbim in e.g. /usr? or some other prefix?
This looks like libmbim was installed in a path out of LD_LIBRARY_PATH.

You can probably solve this just by installing in /usr everything
(both libmbim and libqmi), e.g.:
$ ./configure --prefix=/usr
$ make
$ sudo make install

Another option could be to build libqmi without mbim support if you
don't need that:
$ ./configure --disable-mbim-qmux
...


-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list