Sign in to follow this  

Help!!!!! Error

This topic is 3662 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 Use Visual C++ 2008 and I Compiled a window and I got an Error, but I don't know what it means! Here it is: error C2440: '=' : cannot convert from 'const wchar_t [13]' to 'LPCSTR' Please Respond as soon as possible!!!!!!!!

Share this post


Link to post
Share on other sites
Calm down. Easy on those exclamation marks :)

The first thing you do on these kinds of errors is double click on it, and VC will point you to the line in your code where the error is.
Then, you copy and paste a bunch of lines from that general area into your post, so we can better analyse what's going on.

The error has *something* to do with you mismatching wide and narrow strings. Once you post the actual code, I might be able to come up with an actual solution.

Share this post


Link to post
Share on other sites
Sorry about the Exclamation marks I am just new and want to learn alot. I found out what it was from a guy named Chris. He told me it was because I had L's in front of my output text. I have another problem now though(seems I'm always having Problems). I have an include file from the directx sdk 2007 that I used and it won't let me compile because it says it can't find the file directory or something. Please help!
The header was d3dx9.h, but I was able to load all the other headers except this one. It is in the SDK, but it won't load it!

Share this post


Link to post
Share on other sites
You can go another way with this as well.

My guess is that you're probably copying and pasting code from the DirectX SDK, and discovering that it doesn't compile right out of the box.

That's because they've defined their project to use Unicode chars, and by default, you probably haven't. If you want to get the Unicode chars out of there and just go with standard old C chars (not the most portable solution), dropping the "L's" as you did will take care of it for the most part.

If, on the other hand, you do want to use the wide chars (which you'll be happy you did if you intend to localize your game later on), open the Properties window (in VS2005, at least), and under General->Character Set, select "Use Unicode Character Set". That should get you on your feet.

Share this post


Link to post
Share on other sites
Quote:
Original post by Gabe
I have an include file from the directx sdk 2007 that I used and it won't let me compile because it says it can't find the file directory or something.

'Or something'?

If the linker can't find find an input file, it will tell you all the details. Only you are in a position to find out why it's not being found and to point the linker in the right direction. If you're still stuck, paste us the error, tell us where the file is and how you've told the IDE of its whereabouts and we'll be in a much better position to help.

Share this post


Link to post
Share on other sites

This topic is 3662 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.

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