#1 Members - Reputation: 345
Posted 09 October 2012 - 06:16 PM
My code:
#include "SDL.h"
int main(){
SDL_Init(SDL_INIT_VIDEO);
SDL_Quit();
return 0;
}
My errors:
1>------ Build started: Project: SpaceShooter, Configuration: Debug Win32 ------
1> Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\Mathew\documents\visual studio 2010\Projects\SpaceShooter\Debug\SpaceShooter.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I hate this so much. I followed the tutorial to the letter, i re read it multiple times, and then googled it. I looked for a youtube tutorial Nothing worked. Please im desperate, i need help!
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#2 Crossbones+ - Reputation: 5155
Posted 09 October 2012 - 06:25 PM
Did you link to SDL?
How?
L. Spiro
Edited by L. Spiro, 09 October 2012 - 06:37 PM.
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#3 Members - Reputation: 345
Posted 09 October 2012 - 06:43 PM
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#4 Crossbones+ - Reputation: 5155
Posted 09 October 2012 - 06:47 PM
What is the path you entered into your Library Directories? Copy-paste it.
What did you paste under Additional Dependencies? Copy-paste it.
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#5 Members - Reputation: 345
Posted 09 October 2012 - 06:49 PM
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#6 Members - Reputation: 345
Posted 09 October 2012 - 06:51 PM
Library directories: C:\SDL-1.2.15\lib\x64;$(LibraryPath)
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#7 Crossbones+ - Reputation: 5155
Posted 09 October 2012 - 07:00 PM
What is the path to SDLmain.lib? Open Explorer and browse to the file. Copy-paste its path.
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#8 Members - Reputation: 345
Posted 09 October 2012 - 07:05 PM
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#10 Members - Reputation: 345
Posted 09 October 2012 - 07:57 PM
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#11 Members - Reputation: 345
Posted 09 October 2012 - 08:00 PM
'Space Shooter.exe': Loaded 'C:\Users\Mathew\Documents\Visual Studio 2010\Projects\Space Shooter\Debug\Space Shooter.exe', Symbols loaded.
'Space Shooter.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Space Shooter.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Space Shooter.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
The program '[2036] Space Shooter.exe: Native' has exited with code -1073741701 (0xc000007b).
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#12 Crossbones+ - Reputation: 5155
Posted 09 October 2012 - 08:32 PM
Check your build settings.
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#14 Members - Reputation: 163
Posted 10 October 2012 - 01:26 AM
Someone once told me learning C++ was like learning how to juggle knives...
<= Servant of the Lord, on 06 June 2011 - 04:43 AM, replied:
That's not true at all! C++ doesn't require anywhere near the hand-eye coordination juggling requires. And with C++ after you slip and kill someone with the knife, you can reuse it for something else afterward. With actual knives, you have to get rid of the evidence.
#16 Members - Reputation: 3817
Posted 10 October 2012 - 06:10 AM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
#17 Members - Reputation: 404
Posted 10 October 2012 - 06:34 AM
Also try using
"int main(int argc, char *argv[])" instead of "int main()"... VC was giving me linking errors when using just main()
@OP: I got the same error a few weeks ago and the quoted response solved the problem. You need the arguments to main for SDL to work correctly
#18 Members - Reputation: 243
Posted 10 October 2012 - 06:35 AM
I also included a download in the description could be used as a template as long as you have the SDL folder in the C:/ and copied the DLL to either your current work folder or C:/Windows/system/
let me know if you have any issues
#19 Members - Reputation: 345
Posted 10 October 2012 - 09:12 PM
"C spilled his beer all over C++'s shirt. Outraged, C++ shouted, "Good god, man! Have you no class?"
"Your mother is so fat that the recursive function that was used to calculate her mass created a stack overflow"
#20 Members - Reputation: 163
Posted 11 October 2012 - 01:34 AM
That sounds a little bit too extreme. You really should not have to do that. I am pretty sure you just had some libraries and files in the wrong places.... people said that they had to reformate their drive and, and i did and now it works...
Someone once told me learning C++ was like learning how to juggle knives...
<= Servant of the Lord, on 06 June 2011 - 04:43 AM, replied:
That's not true at all! C++ doesn't require anywhere near the hand-eye coordination juggling requires. And with C++ after you slip and kill someone with the knife, you can reuse it for something else afterward. With actual knives, you have to get rid of the evidence.






