• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Crusable77

SDL pisses me off

19 posts in this topic

Hello, i am trying to use SDL but my IDE (VIsual c++ 2010) wont link SDL properly. I have tries making new projects, moving the folders, and re downloading it. Nothing worked. I am following Lazy Foos tutorials but im cannot get this stupid thing to work.

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!
0

Share this post


Link to post
Share on other sites
The errors you posted are unrelated to your code. These are linker errors, not compiler errors.

Did you link to SDL?
How?


L. Spiro Edited by L. Spiro
1

Share this post


Link to post
Share on other sites
I followed the instructions on Lazy foo's website, http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet2010e/index.php. In the properties i added the path for the include and lib folder. then i changed the runtime library to Multi-Threaded dll. ANd then, under the linker section, i added SDL.lib and SDLmain.lib to the additional dependencies. I also changed the subsystem to Windows (/SUBSYSTEM:WINDOWS). I inputted the code he game me, then i got all those errors.
0

Share this post


Link to post
Share on other sites
What is the full path to SDLmain.lib? Copy-paste it.
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
1

Share this post


Link to post
Share on other sites
There was no path t SDLmain.lib, i just put it in the additional Dependencies SDL.lib;SDLmain.lib;%(AdditionalDependencies):
Library directories: C:\SDL-1.2.15\lib\x64;$(LibraryPath)
0

Share this post


Link to post
Share on other sites
That doesn’t answer my question.
What is the path to SDLmain.lib? Open Explorer and browse to the file. Copy-paste its path.


L. Spiro
0

Share this post


Link to post
Share on other sites
Oh. Its in here C:\SDL-1.2.15\lib\x64, i had moved the Folders around from when i first posted this but i updated the project.
0

Share this post


Link to post
Share on other sites
You are compiling for a Win32 configuration, but the library you're linking to is x64 judging by your library folder. You should link against the Win32 (x86) version of the library
1

Share this post


Link to post
Share on other sites
I changed it, and it doesnt give me the errors but it says: The aplication was unable to start correctly(0xc000007b). Click OK to close the application.
0

Share this post


Link to post
Share on other sites
And this shows up in the output window:

'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).
0

Share this post


Link to post
Share on other sites
That error (INVALID_IMAGE_FORMAT) indicates that your executable is not a valid .EXE file.
Check your build settings.


L. Spiro
1

Share this post


Link to post
Share on other sites
Also try using
"int main(int argc, char *argv[])" instead of "int main()"... VC was giving me linking errors when using just main()
1

Share this post


Link to post
Share on other sites
Did you just copy (or move) the SDL lib from the x64 folder to the x86 one? That won't magically make it a 32-bit library. If you're building a 32-bit program you need a 32-bit library, and it doesn't matter what the folder it's in is called, if it's a 64-bit library it won't link.
1

Share this post


Link to post
Share on other sites
[quote name='n0name' timestamp='1349869948' post='4988682']
Also try using
"int main(int argc, char *argv[])" instead of "int main()"... VC was giving me linking errors when using just main()
[/quote]

@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
1

Share this post


Link to post
Share on other sites
I tryed everything, i google the issue and people said that they had to reformate their drive and, and i did and now it works...YAY!
0

Share this post


Link to post
Share on other sites
[quote name='Mathew Bergen' timestamp='1349925170' post='4988944']
... people said that they had to reformate their drive and, and i did and now it works...
[/quote]
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.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0