Advertisement

help setting up opengl with .net 2k3

Started by May 18, 2004 01:56 AM
7 comments, last by graveyard filla 20 years, 6 months ago
high, i am trying to setup opengl with SDL in .net 2k3 . ive searched the web but cannot find any tutorials on this. anyway, im pretty sure i dont have to download anything correct? (using windows XP pro) anyway, heres the problem: im getting over 100+ errors using the code from lessson 1. im using the SDL version of it (although this says its for linux... it still doesnt explain my errors?). anyway, when i try to compile the SDL/linux version of lesson 1 i get over 100 errors all in GL.h. they are weird errors that dont make sence like missing semi colon and such... does anyone know what the problem could be? i started a blank win 32 app, i have all the SDL libs setup properly, and my code generation is set to multi-threaded DLL. thanks for any help!
FTA, my 2D futuristic action MMORPG
Try including windows.h before the gl headers. The GL headers in MSVC require windows.h and the linux tutorial probably doesn''t list it.
Advertisement
hey sic, that worked, thanks alot. but im still getting 14 errors which i dont understand. its all unresolved external errors for GL functions.. am i missing a header or something? heres the errors:

oglmain.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "int __cdecl resizeWindow(int,int)" (?resizeWindow@@YAHHH@Z)oglmain.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "int __cdecl resizeWindow(int,int)" (?resizeWindow@@YAHHH@Z)oglmain.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "int __cdecl resizeWindow(int,int)" (?resizeWindow@@YAHHH@Z)oglmain.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "int __cdecl resizeWindow(int,int)" (?resizeWindow@@YAHHH@Z)oglmain.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl initGL(void)" (?initGL@@YAHXZ)oglmain.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl initGL(void)" (?initGL@@YAHXZ)oglmain.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl initGL(void)" (?initGL@@YAHXZ)oglmain.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "int __cdecl initGL(void)" (?initGL@@YAHXZ)oglmain.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl initGL(void)" (?initGL@@YAHXZ)oglmain.obj : error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function "int __cdecl initGL(void)" (?initGL@@YAHXZ)oglmain.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl drawGLScene(void)" (?drawGLScene@@YAHXZ)  


my includes are:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL.h>

thanks again for any help!

[edited by - graveyard filla on May 18, 2004 3:25:50 AM]

edit: code tags -> source tags so that the tables aren't broken

[edited by - SiCrane on May 18, 2004 4:17:46 PM]
FTA, my 2D futuristic action MMORPG
It looks like you didn''t link against Opengl32.lib or Glu32.lib.
now i get this error:

ogltesties error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup


i tried doing a win 32 console app and get a similar error. this is what my headers look like now:

#ifdef _WIN32#pragma comment(lib, "SDL.lib")#pragma comment(lib, "OpenGL32.lib")#pragma comment(lib, "GlU32.lib")#endif#include <windows.h>#include <stdio.h>#include <stdlib.h>#include <GL/gl.h>#include <GL/glu.h>#include <SDL.h>  


thanks again for any help...also i found GLU32.lib and OpenGL32.lib in my VC7/platformSDK/lib folder (spelled as i showed).. was i suposed to do something else besides put those headers at the top? thanks again

[edited by - graveyard filla on May 18, 2004 3:50:15 AM]
FTA, my 2D futuristic action MMORPG
can anyone help me. i cant find any help on google for setting up open gl in .net 2k3... i dunno what i could be doing wrong.. its just that one errors still.. also, if i do a win32 console app it says

"MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup"

instead... i dont know what this means... ? thanks for any help!
FTA, my 2D futuristic action MMORPG
Advertisement
Have you checked if your code actually did provide main() or WinMain() ?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
More importantly, since you''re using SDL with GL, did you link against the SDLmain library?
duhhhhhhhhhhhhhhhhhhhhhhhhh how could i forget that... thanks guys!!! (forgot SDLmain.lib!).. whoohoo now i can start learning thanks again

also for some reason the window is running really slow... maybe its just how this tutorial is? it seems like its not updating very often or something.. ie, when i resize the window, i get trails for a few seconds before it "snaps" in... same thing if i move the window around and push it below the bottom "start" windows task bar thingy.... guess its just this tutorial thats doing it? also the console pops up every 5 seconds and says "xxx frames in 5 seconds... = xxx FPS"... maybe its only updating every 5 seconds? i dunno, guess i gotta keep reading.. thanks again

[edited by - graveyard filla on May 18, 2004 4:32:34 PM]
FTA, my 2D futuristic action MMORPG

This topic is closed to new replies.

Advertisement