SDL Problem
Author |
Message |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Sun Sep 16, 2012 3:41 pm Post subject: SDL Problem |
|
|
So I have been trying to play with SDL since it was another popular graphics library currently available for c++ and they are updating for OpenGL 3.0 support. which is awesome. I have linked other libraries and whatnot before like GLWF but for some reason I cant get SDL to work. I am using Visual Studio 2010 on Windows 7 and here is what I did:
First downloaded SDL Dev Lib for C++
Then I extracted the folder to my C Drive
I then opened Visual Studio
I created a new windows 32 empty console application. Named it batman.
I went to project then properties went into VC++ directories
Then I set the Include as include and libary as library -> X86 bit
I next went under linker input and added the library names SDL.lib and SDLmain.lib
went to test it, however it gave me the error:
code: | 1>------ Build started: Project: Tutorial, Configuration: Debug Win32 ------
1>Build started 16/09/2012 4:38:32 PM.
1>InitializeBuildStatus:
1> Touching "Debug\Tutorial.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>
1>SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external symbol _SDL_main referenced in function _main
1>
1>C:\Users\Christian\Documents\Visual Studio 2010\Projects\Tutorial\Debug\Tutorial.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.80
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
It compiles fine however it wont build when it gets to the linker.
Here is my code I used:
c: | #include <SDL.h>
int _main (int argc, char argv[]){
if (!SDL_Init (SDL_INIT_EVERYTHING) == 1){
return 0;
}
system("pause");
return 0;
}
| '
If someone could help I would appreciate anything to try. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
bl0ckeduser
|
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Mon Sep 17, 2012 9:23 am Post subject: Re: SDL Problem |
|
|
I read your post and I tried what you said and you were defiantly right about the main declaration.
I changed my code to:
C: | #include <SDL.h>
int main (int argc, char *argv[]){
if (SDL_Init (SDL_INIT_EVERYTHING) == 0){
return 0;
}
system("pause");
return 0;
}; |
The code complies and builds however it does not run. I get the error:
code: | 'Tutorial.exe': Loaded 'C:\Users\Christian\Documents\Visual Studio 2010\Projects\Tutorial\Debug\Tutorial.exe', Symbols loaded.
'Tutorial.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Tutorial.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Tutorial.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
The program '[10292] Tutorial.exe: Native' has exited with code -1073741515 (0xc0000135). |
And on screen I get the prompt:
code: | The Program can't start because SDL.dll is missing from your computer. Try re-installing the program to fix this problem. |
|
|
|
|
|
![](images/spacer.gif) |
Ultrahex
|
Posted: Mon Sep 17, 2012 10:04 am Post subject: Re: SDL Problem |
|
|
that means that the dynamically linked library (linked at runtime) SDL.dll is not on the path. Typically people put in the same folder as the executable (.exe) or modify the path (not sure how this works on windows). |
|
|
|
|
![](images/spacer.gif) |
copthesaint
![](http://compsci.ca/v3/uploads/user_avatars/15853548854c9c056fda48d.jpg)
|
Posted: Mon Sep 17, 2012 7:03 pm Post subject: RE:SDL Problem |
|
|
Thanks, I feel like an idiot for not checking if I put it in my folder lol. |
|
|
|
|
![](images/spacer.gif) |
|
|