Pregunta

I'm trying to compile a simple program using the GeoIP2 lite API. I've compiled the GeoIP Lite program and it created the library files. The .la file is in /mydir/libmaxminddb-0.5.3/src

I modified my .pro file to include:

LIBS += /mydir/libmaxminddb-0.5.3 -lmaxminddb

but when I compile my project errors with "Cannot find -lmaxminddb"

Can someone tell me what's wrong? I've tried changing directories, adding a "lib" prefix to the maxminddb, and more, but I can't figure it out.

(I'm trying to link against libmaxminddb.a which is pointed to by libmaxminddb.la)

¿Fue útil?

Solución 2

I found elsewhere that with Qt Creator you can right click the project and add an external library. When I do so, I see the .pro file adds:

LIBS
INCLUDEPATH
DEPENDPATH

So that's what you need to add!

Otros consejos

I believe in autoconf and friends the -l flags go in the LDFLAGS variabe, not LIBS.

That should be LIBS += -L/mydir/libmaxminddb-0.5.3 -lmaxminddb. Note the extra -L in front of the directory name.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top