Question

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)

Était-ce utile?

La solution 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!

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top