Hi all, First of all Merry Christmas to all of you, i m facing a problem,i hav made a c++ dll using cl compiler, defined overloaded functions, but now the problem is when i call any of the function using LoadLibrary, GetProcAddress returns NULL, it cant find the function. So overall the problem is How to export Overloaded functions of c++ from a dll. My code for exporting is like: . #ifdef _EXPORTS #define _API __declspec(dllexport) #else #define _API __declspec(dllimport) #endif _API void Calculate(); _API int Calculate(std::string str); _API int Calculate(std::string, vector); . . . I also made a .def file and put simply ““Calculate”” in EXPRTS section but then linker generates an error ““cannot resolve one or more undecorated symbols””, there is a solution for that i put the decorated names of functions in .def file, but then the program which will use the dll functions should be compiled with the same compiler who built dll.This is not my purpose. Can any one help me out… Thanks in advance…
If I understand your question correctly then the possible solution could be
the following.
- Open up the dll to see which functions it is exporting (Use dependy walker
application which comes with VC++).
- You should be able to see the exact function name exported from the dll
and its ordinal value.
- Use the name or ordnial value for GetProcAddress() and you should be able
to get the function address.
Regards
Sanjay