Errors after running NeHe Lesson 2

Compiler: VC++ '08
OS: Windows 7 Starter Edition

I have installed all the miscellaneous header files into their proper places (I specify that because it gave me a lot of trouble- specifically, I put in gl.h, glaux.h, and glut.h. It wouldn't have been so bad if I hadn't gone on a wild goose chase through the Internet hunting down the wrong file.) I am trying to run Lesson 2 of NeHe's OpenGL tutorial, but I'm getting odd error messages. No idea what's wrong.


Also, I'm sorry if this is the wrong forum website to do this. It just seemed convenient to go here, and I figured someone might recognize what was wrong.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
1
1>Compiling...
1>nehelesson2.cpp
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(87) : 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
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(92) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [34]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(99) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [31]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(105) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(109) : 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
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(111) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(147) : error C2440: '=' : cannot convert from 'const char [7]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(151) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [37]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(169) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [94]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(176) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(209) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(212) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [23]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(241) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [34]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(248) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [35]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(255) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [27]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(262) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [37]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(269) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [41]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(281) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [23]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\noahpocalypse\documents\visual studio 2008\projects\prototype\prototype\nehelesson2.cpp(358) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [42]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\Users\noahpocalypse\Documents\Visual Studio 2008\Projects\prototype\prototype\Debug\BuildLog.htm"
1>prototype - 19 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Have you tried these?

 
MessageBoxW(NULL, L"Hello World!", L"Hello World", MB_OK);

Or
 
MessageBox(NULL, TEXT("Hello World!"), TEXT("Hello World"), MB_OK);


Note: I do not know much about the Windows API so I might not be correct.
Last edited on
Topic archived. No new replies allowed.