QLibrary, problem with using external dll, in release
Hello.
Need help.
I try to use external dll in my application. Code is..
Code:
if(lib.load())
qDebug("\n Library is loaded \n");
else
qDebug ("\n Library is not loaded \n");
typedef int (*MyPrototype)(char*,char* ,char*,char*,char *);
MyPrototype myFunction = (MyPrototype) lib.resolve("func");
if (myFunction){
int tmp = myFunction("qwe","qwe","qwe","qwe","qwe");
qDebug("Library start,tmp =%d", tmp);
}
Function signature in the external dll is:
int WINAPI func(const char*,const char*,const char*,const char*,const char*)
Everything work fine if i compile my application in debug mode, but if i try to compile in release and run, program send exception "The instruction at.... The memory could not be "read"". This happens then a try call myFunction(.....). What i`m doing wrong?
Thanks.
PS
Sorry for my english.
Re: QLibrary, problem with using external dll, in release
Please post the full error message.
And note that you can not use just any library this way. It's explained in the documentation.
The correct way to use this library is to link to it and include the header files.
Re: QLibrary, problem with using external dll, in release
Full error message:
The instruction at "0x488b386f" referenced memory at "0x00000001". The memory could not be "read".
Quote:
And note that you can not use just any library this way.
But, in debug mode everything work!!!This means that i can use this library in that way.
Quote:
The correct way to use this library is to link to it and include the header files.
How? Simply, add path to library into project file and include header file? But i dont have lib.a file.... this is not my lib, i'm only have lib.dll and function signature.
Re: QLibrary, problem with using external dll, in release
Thanks all.
I thix it.
The problem was in external lib, exactly in absense of DB that use this library. When i start my application on real server everything work ok!!!