SDL Tutorials in C++
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++?
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.
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.
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.
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?
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?
1.Where did you get the code from?
2.Add a new line. Just hit enter after this "}".
2.Add a new line. Just hit enter after this "}".
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.
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement