Problems with dll

Started by
6 comments, last by Paradigm Shifter 10 years, 5 months ago

I have a dll and I'm trying to use it in an app.I added __declspec(dllexport) to the class I'm trying to use,but I still get unresolved symbol for one of it's functions.

Suggestions?

Advertisement

Have you actually implemented the function (i.e. not just declared it?)

EDIT: It's not a template function is it?

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

It's not a template function,and yes it's implemented.

NOTE: There are other functions,like the constructor in that class which i can call without problems,the only problem is caused by one function....

Post the declaration and the error then...

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

class __declspec(dllexport) Terrain{

public:

bool            LoadHeightMap ( LPCTSTR FileName, ULONG Width, ULONG Height );

}

And the error. Also show how you call it (and include the declaration of Terrain object you call it with).

Could be a typo, perhaps?

EDIT: And I see you use an LPCTSTR, are both builds using the same character types (i.e. ANSI vs. UNICODE build)? <<< My guess of what is wrong. My typo guess is something along the lines of LoadHieghtMap instead of LoadHeightMap.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

damn it...i was using ANSI in one,UNICODE in the other...that was the problem...

Thanks for your help.

I knew it!

You can define both versions as well and use a macro to call the correct implementation (see how MessageBox is mapped to either MessageBoxA or MessageBoxW in the windows headers).

EDIT: Since it is C++ you don't even need a macro, you can just overload the function for both types of parameters. MessageBoxA and MessageBoxW are C functions so a macro is required.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

This topic is closed to new replies.

Advertisement