Visual studio.net

Help!!!
Why does not work this code in Visual studio.net?
#pragma comment(lib,“glaux.lib”)
#pragma comment(lib,“opengl32.lib”)
#include “stdafx.h”
#include “windows.h”
#include “gl/GL.h”
#include “gl/GLU.h”
#include “gl/GLAux.h”
int _tmain(int argc, _TCHAR* argv[])
{
auxInitDisplayMode(AUX_RGB);
auxInitPosition (0, 0, 500, 500);
auxInitWindow (“1”);
return 0;
}

Gives out mistakes of type:

555 error LNK2019: unresolved external symbol _auxInitWindowA@4 referenced in function _main
555 error LNK2019: unresolved external symbol _auxInitPosition@16 referenced in function _main
555 error LNK2019: unresolved external symbol _auxInitDisplayMode@4 referenced in function _main

Well you could do the following:

go to menu bar on top of you’r screen
“Project” -> “settings” -> “link” ->
“Object/Library modules” you will see some libraries: “kernel32.lib user 32.lib …”

add the following libraries: Opengl32.lib Glu32.lib glaux.lib

The unresolved external thing means that the linker couldn’t find an .obj or .lib with the functions you call. Either the pragmas don’t work and glaux.lib is not in the linker’s path (in this case, Tenson’s solution should work), or glaux.lib does not exist (I’m not sure glaux is shipped with visual studio.net).

Anyway, I can only recommend you to not use the glaux library. It is obsolete and no longer supported. You could try glut or glfw as an alternative.

Thank has earned all!
But why do not work:
#pragma comment(lib,“glaux.lib”)
#pragma comment(lib,“opengl32.lib”)