Hi,
I'm using QTCreator (first time) to build a project that links to a shared library.
I've added (hopefully) the correct macros to the .pro file
INCLUDEPATH += /path/to/include/
LIBS += -L/path/to/lib -lmylib
INCLUDEPATH += /path/to/include/
LIBS += -L/path/to/lib -lmylib
To copy to clipboard, switch view to plain text mode
but linking fails due to "undefined reference to" error.
I managed to solve the problem by using QTLibrary as explained at the
following link
http://www.riverbankcomputing.co.uk/...y.html#details
with the following example.
typedef void (*MyPrototype)();
MyPrototype myFunction = (MyPrototype) myLib.resolve("mysymbol");
if (myFunction)
myFunction();
QLibrary myLib("mylib");
typedef void (*MyPrototype)();
MyPrototype myFunction = (MyPrototype) myLib.resolve("mysymbol");
if (myFunction)
myFunction();
To copy to clipboard, switch view to plain text mode
Now I'd like to understand what I'm doing wrong because I'm sure can't resolve all library symbols that way.
Thanks in advance.
Bookmarks