Re: [Dev-C++] explicit linking of DLL
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <or...@vp...> - 2004-09-13 10:27:50
|
Dmitry Sidorov wrote:
> ....
> Both DLL and main program are compiled and linked without errors
> But when I`m trying to run a program, it is crushing in a line
> Number *num =3D create();
>=20
> What do I wrong?
Make sure your program is compiled as a console executable (without -mwin=
dows) otherwise=20
you won't see what you print out.
Also, add the line
exit(1);
here
if( !hMod ) {
cout << "Failed to Load the dll: " << GetLastError() << endl;
exit (1);
}
to make sure you exit if the DLL cannot be loaded.
BTW, the program runs fine for me, and prints the right value. I guess yo=
ur DLL isn't=20
loaded for some reason. (You load "mydll.dll", are you sure it's the name=
of your DLL too?)
--
Greetings,
Bal=E1zs
|