Sign in to follow this  
noatom

Problems with dll

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this