문제

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)

도움이 되었습니까?

해결책 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!

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top