Jump to content
  • Advertisement
Sign in to follow this  
Meta Adam

SDL Tutorials in C++

This topic is 5036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've taken a look at the SDL tutorials at Cone3d and they are in C. Sadly I dont know much C. So is there any tutorials out there written for SDL in C++?

Share this post


Link to post
Share on other sites
Advertisement
I am starting to do some tutorials on my site that will use no C output and input functions at all. The link is in my sig. Actually there is only one on there right now but I am doing another right now.

Share this post


Link to post
Share on other sites
The Cone3D tutorials are C++ - some of the later tutorials use classes and such but they are written in a C fashion for the most part. For some other tutorials beside those listed is this one.

Share this post


Link to post
Share on other sites
Just replace printf with cout. You should be able to understand it anyways, he uses some c functions but you should get the SDL part fine.

Share this post


Link to post
Share on other sites
Okay, the compilier is telling me there is a syntax error in the header file.
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\HP_Owner\Desktop\C++\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\HP_Owner\Desktop\C++\Makefile.win" all
g++.exe -c SDL.cpp -o SDL.o -I"C:/Dev-Cpp/include/c++/3.3.1" -I"C:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"C:/Dev-Cpp/include/c++/3.3.1/backward" -I"C:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"C:/Dev-Cpp/include"

In file included from C:/Dev-Cpp/include/SDL/SDL.h:39,
from SDL.cpp:4:
C:/Dev-Cpp/include/SDL/SDL_audio.h:97: error: syntax error before `[' token

SDL.cpp:14:2: warning: no newline at end of file

make.exe: *** [SDL.o] Error 1

Execution terminated

Theres what it looks like.

Adam


edit: Also, why is it always giving me a warning about no newline at end of file?

Share this post


Link to post
Share on other sites
What do you mean where did I get the code from, and what do you mean by Just hit enter after this }?

If you are asking what I think you are, I got the code from Rob Loach's website, but it's giving me syntax error IN the header file, the syntax error is in SDL_audio.h.

Share this post


Link to post
Share on other sites
Sometimes you get that after doing a copy paste from another source like a web page. A small suggestion is make a directory in the root of C or which ever drive instead of using files deep in your desktop. What I do is make a c:\Source directory and then make directories inside that.

Also are you using DevCpp? if so have you install the SDL package. Also if you have you need to specify #include "SDL/SDL.h"

Let us know if any of that helps.

=)
Fud

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!