i recently installed SDL and VS 2010 on a new computer and im having issues with my test application. here is the code:
#include <SDL.h>
#include <SDL_opengl.h>
#undef main
int INIT_SDL_OPENGL()
{
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
{
return 1;
}
SDL_SetVideoMode(640, 360, 32, SDL_OPENGL);
SDL_WM_SetCaption("Skeleton Example", NULL);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
return 0;
}
void EndQuitly()
{
SDL_Quit();
exit(0);
}
int main(int argc, char **argv)
{
INIT_SDL_OPENGL();
glBegin(GL_LINES);
glVertex2f(360, 180);
glVertex2f(640, 360);
glEnd();
EndQuitly();
return 0;
}
and the errors are:
error LNK1120: 4 unresolved externals C:\Users\einat\Documents\Visual Studio 2010\Projects\SkeletonOpenGLExample.c\Debug\SkeletonOpenGLExample.exe 1 SkeletonOpenGLExample error LNK2019: unresolved external symbol _SDL_Init referenced in function "int __cdecl INIT_SDL_OPENGL(void)" (?INIT_SDL_OPENGL@@YAHXZ) C:\Users\einat\Documents\Visual Studio 2010\Projects\SkeletonOpenGLExample.c\SkeletonOpenGLExample.c\testSDL.obj SkeletonOpenGLExample error LNK2019: unresolved external symbol _SDL_Quit referenced in function "void __cdecl EndQuitly(void)" (?EndQuitly@@YAXXZ) C:\Users\einat\Documents\Visual Studio 2010\Projects\SkeletonOpenGLExample.c\SkeletonOpenGLExample.c\testSDL.obj SkeletonOpenGLExample error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function "int __cdecl INIT_SDL_OPENGL(void)" (?INIT_SDL_OPENGL@@YAHXZ) C:\Users\einat\Documents\Visual Studio 2010\Projects\SkeletonOpenGLExample.c\SkeletonOpenGLExample.c\testSDL.obj SkeletonOpenGLExample error LNK2019: unresolved external symbol _SDL_WM_SetCaption referenced in function "int __cdecl INIT_SDL_OPENGL(void)" (?INIT_SDL_OPENGL@@YAHXZ) C:\Users\einat\Documents\Visual Studio 2010\Projects\SkeletonOpenGLExample.c\SkeletonOpenGLExample.c\testSDL.obj SkeletonOpenGLExample
i have looked up several tutorials and followed all the linking instructions but none if them seem to work.
thanks in advance (sorry i couldn't figure out how to get the errors properly formatted