I found the following code for loading libraries in Qt but I do not fully understand how it works. Could someone explain to me from: typedef int (*MyPrototype)(int, int);
?
int r1 = 0;
QLibrary library("mathlib.so");
if (!library.load())
out << library.errorString() << endl;
if (library.load())
out << "library loaded" << endl;
typedef int (*MyPrototype)(int, int);
MyPrototype myFunction = (MyPrototype)library.resolve("add");
if (myFunction)
r1 = myFunction(a,b);
else
out << library.errorString() << endl;