Public Group

# Visual Studio 2005 porting question

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

## Recommended Posts

I'm trying to move my OpenGL program from a MSVC6 project to a MSVC 2005 Express one. I'm getting most of the wrinkles ironed out, but I've got one that has me stumped. It comes when I'm creating the window. Previously, I had been using std::string to hold things such as the Class name and Window Title, using the .c_str() operator to convert it to something CreateWindowEx() could use. This worked just fine under MSVC6. In 2005, it gives the error that it:
cannot convert from 'const char *' to 'LPCWSTR'.
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I tried doing a reinterpret_cast as it suggested, but it ends up garbling the title of the window, and I get an error when attempting to unregister the Class. (On a side note, when I go to unregister, I'm using a hardcoded string, saying it "cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR'"). I'm not really on the up and up about how windows are created. This segment of code is rather cut-and-paste, so I don't have a good understanding of why this is failing. Thanks.

##### Share on other sites
Go to the project settings, under general there should be a setting labeled "character set" and it will be set to "Use Unicode Character Set". Switch it to "Use Multi-Byte Character Set" and that should get rid of those kinds of problems.

Alternately, you can migrate your project to use Unicode characters instead of normal chars.

##### Share on other sites
Great, that works. Looks like I'm going to have to Google Unicode. I've heard about it, but don't really know what it is.

##### Share on other sites
Alright, next question:

I've added a rather large section of my code back into the project, fixing incompatabilities as I find them. When it gets to linking, it says it can't find LIBC.lib. Now, I could just grab an old LIBC.lib and copy to a place where it can find it, but the documentation I'm seeing states that it should no longer be used. What is the 'proper' fix for this?

##### Share on other sites
I had the same problem then I added LIBC.lib to the Ignore Specific Library part under linker/input and it fixed the problem.
In visual studio 2005 the static c runtime libs dont exist anymore.
And thats why the dlls should be provided with you app or it wont work on the target machine as far as i know and learnt from the discussions on the net.
I may be wrong though :|

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 12
• 29
• 11
• 44
• ### Forum Statistics

• Total Topics
634856
• Total Posts
3019661
×