<div dir="ltr">Hi guys<div><br></div><div>I'm writing a simple C code to interface to MM to be able to read some stats. I'm following the mmcli examples as was suggested earlier.</div><div><br></div><div>All I'm currently reading is mm_modem_get_manufacturer (ctx->modem); so nothing complex.</div><div><br></div><div>I have the following headers:</div><div><br></div><div><div>#include "config.h"</div><div><br></div><div>#include <stdio.h></div><div>#include <stdlib.h></div><div>#include <locale.h></div><div><br></div><div>#define _LIBMM_INSIDE_MMCLI</div><div><br></div><div>#include <glib.h></div><div>#include <gio/gio.h></div><div><br></div><div>#include <libmm-glib/libmm-glib.h></div><div>#include "../libmm-glib/mm-modem.h"</div><div><br></div><div>#include "mmcli.h"</div><div>#include "mmcli-common.h"</div></div><div><br></div><div>I have a simple Makefile for it too:</div><div><div>CC=gcc</div><div><br></div><div>top_build_prefix = ../</div><div>top_builddir = ..</div><div>top_srcdir = ..</div><div>MMCLI_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/gio-unix-2.0/</div><div>CFLAGS= \</div><div>        $(MMCLI_CFLAGS) \</div><div>        -I$(top_srcdir) \</div><div>        -I$(top_srcdir)/include \</div><div>        -I$(top_builddir)/include \</div><div>        -I$(top_srcdir)/libmm-glib \</div><div>        -I${top_srcdir}/libmm-glib/generated \</div><div>        -I${top_builddir}/libmm-glib/generated</div><div><br></div><div>MMCLI_LIBS = -lgio-2.0 -lgobject-2.0 -lglib-2.0</div><div><br></div><div>LDFLAGS=$(MMCLI_LIBS) \</div><div>        $(top_builddir)/libmm-glib/<a href="http://libmm-glib.la">libmm-glib.la</a></div><div><br></div><div><br></div><div><br></div><div>all: ali</div><div><br></div><div>build: ali.o</div><div>        $(CC) ali.o -o ali</div><div><br></div><div>ali.o: ali.c</div><div>        $(CC) $(CFLAGS) $(LDFLAGS) $(MMCLI_LIBS) ali.c</div><div><br></div><div>clean:</div><div>        rm *o ali</div></div><div><br></div><div><br></div><div>The code is placed in cli/ alongside mmcli source codes.</div><div><br></div><div>When I build it with the makefile I get the following error:</div><div><div>root@beaglebone:~/MM/ModemManager-1.4.12/cli# make -f aliMake </div><div>gcc -pthread -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/gio-unix-2.0/ -I.. -I../include -I../include -I../libmm-glib -I../libmm-glib/generated -I../libmm-glib/generated -lgio-2.0 -lgobject-2.0 -lglib-2.0 ../libmm-glib/<a href="http://libmm-glib.la">libmm-glib.la</a> -lgio-2.0 -lgobject-2.0 -lglib-2.0 ali.c</div><div>../libmm-glib/<a href="http://libmm-glib.la">libmm-glib.la</a>: file not recognized: File format not recognized</div><div>collect2: ld returned 1 exit status</div><div>make: *** [ali.o] Error 1</div></div><div><br></div><div><br></div><div>But when I make mmcli it compiles fine. </div><div><br></div><div>What am I doing wrong/missing? </div><div>Thanks for your help</div><div><br></div><div><br></div></div>