Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Could Not Debug Lesson 5


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 BeginnerX   Members   -  Reputation: 100

Like
0Likes
Like

Posted 27 February 2011 - 03:12 AM

I cannot debug the OpenGL Tutorial Lesson 5 when I copy the coding into a new project file. This is the error message that I had encountered:

1>c:\users\user\documents\visual studio 2008\projects\3d object\3d object\3d object.cpp(118) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'

I am using Microsoft Visual C++ 2008.


Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 3640

Like
0Likes
Like

Posted 27 February 2011 - 06:30 AM

You are probably compiling for unicode while the tutorial is written without support for it. You can surround your strings with TEXT("str") to automatically make strings wide-strings when needed.

If you want to compile the code as is, go into your project settings and under General settings change "Use Unicode Character Set" to "Not Set" for Character Set.

#3 BeginnerX   Members   -  Reputation: 100

Like
0Likes
Like

Posted 01 March 2011 - 03:15 AM

Thanks for the reply.

I have changed the Character Set. This time there were no errors when compiling. But when I tried to build the solution, it detects 21 errors regarding unresolved external symbol. Here are the errors:

1>try.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)

1>try.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)

1>try.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)

1>try.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)

1>try.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glColor3f@12 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)

1>try.obj : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z)



#4 Erik Rufelt   Crossbones+   -  Reputation: 3640

Like
0Likes
Like

Posted 01 March 2011 - 06:27 AM

You must link to opengl32.lib and glu32.lib. The easiest way is to add the following at the top of your main code file.
#pragma comment (lib, "opengl32.lib")
#pragma comment (lib, "glu32.lib")

Or you can go into your project settings again and under Linker and Input there is an additional dependencies option where you can add libraries.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS