Question about dll
-
I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error: error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z) When I look at the dll, I see ... 314 139 00001131 ?function@testclass@@QAEXPBG@Z Apparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?
-
I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error: error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z) When I look at the dll, I see ... 314 139 00001131 ?function@testclass@@QAEXPBG@Z Apparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?
Hi! You have to declare the class as "__declspec(dllimport)". And you also have to include the *.LIB file for your DLL. You can do this in the Link section of your project settings or by inserting the pragama in the source code. For example: #pragma comment(lib, "MyClass.lib") Regards, Alex Gorev, Dundas Software. ================== The original message was: I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error:
error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z)When I look at the dll, I see
...
314 139 00001131 ?function@testclass@@QAEXPBG@ZApparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?