   compile errors: OGL and cross platform utility libraries (like: glut, sdl, etc)
  Hi!I don''t know why, but when I try to compile any GLUT or SDL program using opengl I always get a bunch of compilation errors about windows types. Like WINGDIAPI and APIENTRY.It works if I include windows.h, but that messes up the point of using GLUT or SDL...I could get GLUT to work if I was very careful to _only_ inlude glut.h and not glu.h or gl.h everywhere I needed. And the order which I included stuff, but...I can''t get SDL to work #include <GL/gl.h>#include <GL/glu.h>#include "SDL.h"I''ve tried all orders, putting sdl.h first and so on, but nothing works!How come?    "No lies of sugar can sweeten the sournes of reality"}+TITANIUM+{ A.K.A. DXnewbie[onMIRC] 
  bet you get these errors in gl.hso try placing the sdl include above the gl ones(to be more precise sdl.h includes windows.h but just on windows systems --> platform independance...) ;  There is an SDL_opengl.h header included with SDL.   ;  Null and void: yes you're right, their errors in gl.h#include "SDL.h"#include <GL/gl.h>#include <GL/glu.h>didn't help. I've tried several combinations, even only including either gl.h or glu.hLousyPhreak: just including sdl.h gave me a bunch of gl error, like error C2065: 'GLfloat' : undeclared identifierI added the #include "sdl_opengl.h" myself and it went to linker errors  lesson02 error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function _drawGLSceneI've got #ifdef WIN32#pragma comment(lib, "SDL.lib")#pragma comment(lib, "SDLmain.lib")#endifin the beginning. I'm using multithreaded dll, and have sdl.dll in my debug folder.What's going on? "No lies of sugar can sweeten the sournes of reality"}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]   [edited by - Seriema on August 3, 2003 5:31:30 AM];  just use #ifdef WINDOWS#include <windows.h>#endif//WINDOWSbut i don''t know wheter WINDOWS is the correct macro, look inside the sdl headers you should be able to find the appropriate macro inside there ;quote:I added the #include "sdl_opengl.h" myself and it went to linker errorslesson02 error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function _drawGLScene Link opengl32.lib and glu32.lib. ;  YEEY!linking the ogl libs helped! Thanx a million!   one curious question though... how cross plattform is that? I'm linking with #pragma, but I guess there are other ways for other platforms? I thought SDL would take care of everything :/"No lies of sugar can sweeten the sournes of reality"}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]   [edited by - Seriema on August 3, 2003 10:25:41 AM];  To link without pragma under MSVC, go to Projects -> Settings, then select the "Link" tab and add the library name in the "Object/library modules" list.> I thought SDL would take care of everything :/The SDL already take care of many things. You just have to set it up when you start your project since the settings depend on your compiler/platform but once you''re done with it, you don''t have to worry any more. 