🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

basic question about lesson 1

Started by
2 comments, last by SimonForsman 13 years, 2 months ago
Forgive me if I'm overlooking something very basic, but I'm using Visual C++ 2008 express, and I believe it does not support the glaux library. Anyways I downloaded the replacement code as lesson 1 suggested but now I have no idea what to do with it or how to use it? Any help would be much appreciated.
Advertisement
you don't need glAux, the only thing glaux is used for is bmp loading, and for that check the link in my signature.
But that's not until lesson 6.
hey, i've got a problem with lesson1 too. i use microsoft visual studio 2008 express edition. i've added the required .lib at project>>project properties>>linker>>input>>additional dependencies

but when i 'm trying to compile my code (it is just a copy-paste from the downloaded file to my own project), this error warning show up.


this is for every MessageBox () line,
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

and this for another error warning,


error C2664: 'UnregisterClassW' : cannot convert parameter 1 from 'const char [7]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


but when i'm trying to compile the downloaded file, it works fine!!
am i missing something? i'm still new playing with OpenGL.

i would greatly appreciate any help.

hey, i've got a problem with lesson1 too. i use microsoft visual studio 2008 express edition. i've added the required .lib at project>>project properties>>linker>>input>>additional dependencies

but when i 'm trying to compile my code (it is just a copy-paste from the downloaded file to my own project), this error warning show up.


this is for every MessageBox () line,
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

and this for another error warning,


error C2664: 'UnregisterClassW' : cannot convert parameter 1 from 'const char [7]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


but when i'm trying to compile the downloaded file, it works fine!!
am i missing something? i'm still new playing with OpenGL.

i would greatly appreciate any help.


the conversion errors are due to the project using unicode which means the Windows message boxes will expect unicode strings, use wchar_t instead of char and L"some text" instead of "some text" for static strings. (http://unicode.org/standard/WhatIsUnicode.html)

you can also use std::wstring instead of std::string.

The Windows headers should also declare a TEXT macro, so rather than using L"some text" you can use TEXT("some text") and the code will keep working properly regardless of unicode support, for character variables the appropriate macro is TCHAR.

You could also add similar functionality for c++ strings using:
namespace std
{
typedef basic_string<TCHAR> tstring;
}

and so on for other streams if needed.

(If you only intend to support modern desktop systems then you can just ignore the conversion macros and just use unicode directly)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement