• Advertisement
Sign in to follow this  

Problems with dll

This topic is 1579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement

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

 

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

Edited by Paradigm Shifter

Share this post


Link to post
Share on other sites

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....

Share this post


Link to post
Share on other sites
class __declspec(dllexport) Terrain{

public:

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

}

Share this post


Link to post
Share on other sites

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.

Edited by Paradigm Shifter

Share this post


Link to post
Share on other sites

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

 

Thanks for your help.

Share this post


Link to post
Share on other sites

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.

Edited by Paradigm Shifter

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement