Correct way of including SDL?

Hello everyone!

OK, I’ve heard the correct way of using SDL is this:
#include <SDL.h>
and passing sdl-config --cflags to the compiler, but there’s no such
file sdl-config in Windows… :confused:

How should I do it? Just move all the files in include/SDL to include?

Thanks!

Add the directory with the SDL include files to your include path.On 9/3/07, L-28C wrote:

Hello everyone!

OK, I’ve heard the correct way of using SDL is this:
#include <SDL.h>
and passing sdl-config --cflags to the compiler, but there’s no such
file sdl-config in Windows… :confused:

How should I do it? Just move all the files in include/SDL to include?

Thanks!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello everyone!

OK, I’ve heard the correct way of using SDL is this:
#include <SDL.h>
and passing sdl-config --cflags to the compiler, but there’s no such
file sdl-config in Windows… :confused:

How should I do it? Just move all the files in include/SDL to include?

I usually just add include/SDL to the include search path manually. Or
crosscompile from linux.On Mon, Sep 03, 2007 at 08:41:24PM -0400, L-28C wrote:

Thanks!

No. You #include “SDL.h”. And if ‘sdl-config’ is unavailable, or unusable
in your build environment, just make sure that you add the path to the SDL
headers to your build system’s header path. (e.g., with GCC you’d
do an “-I” to add an additional include path)

That’s the most portable way.

-bill!On Mon, Sep 03, 2007 at 08:41:24PM -0400, L-28C wrote:

Hello everyone!

OK, I’ve heard the correct way of using SDL is this:
#include <SDL.h>
and passing sdl-config --cflags to the compiler, but there’s no such
file sdl-config in Windows… :confused:

Hello !

#include <SDL.h>

No, the most portable way is to do: #include “SDL.h”

and passing sdl-config --cflags to the compiler, but there’s no such
file sdl-config in Windows… :confused:

sdl-config is only used with
commandline environments.

What Win32 compiler do you use ?

With VC you have two ways, either you add them to
your project or you add the necessary SDL dirs. to the
VC include, bin, lib dirs and so on.

CU

What Win32 compiler do you use ?

i find the simplest way to get using SDL in the windows is to use
bloodshed dev
c++ which has progect packages for SDL so you can download them easilly and
then all you need is a list like

-lmingw32
-mwindows
-lSDLmain
-lSDL
-lSDL_image
-lSDL_mixer
-lSDL_ttf

in the progect option -> parameters - linker window

then you are away, there are a few downsides to this, one, the packages
are not
kept up to date ( i should probably deal with this for SDL as i am
always using
it :wink: ) and the bloodshed devc++ IDE is no longer active and as a few minor
bugs, but they rearely affect productrivity too much.

just thought i’d throw in my marshmellow of what i belive to be the
easiest way
to get setup in the doze.

neil at cloudsprinter.com wrote:

What Win32 compiler do you use ?

i find the simplest way to get using SDL in the windows is to use
bloodshed dev
c++ which has progect packages for SDL so you can download them easilly and
then all you need is a list like
-lmingw32
[snip]
in the progect option -> parameters - linker window

Not really very good advice. Experienced coders will go for
configuration files: autoconf, Makefile or whatever VC has. On
Win32, I’d recommended following Torsten’s advice; get MinGW/Msys
and learn how to write Makefiles. Running “make” in a shell window
is just as easy as clicking buttons on spiffy IDEs; you can use
for favourite editor, I use SciTE for instance.

Since “Managing Projects with GNU Make” is freely downloadable
now, there’s really no more reason to continue to do any manual
project configuration using GUI dialog boxes. Are we going to ask
prospective developers to “set this” “set that” on an IDE for our
project, whether commercial or open source? That’s an adoption
barrier. Surely, the earlier one learns how to write configuration
files or Makefiles, the better.

then you are away, there are a few downsides to this, one, the packages
are not
kept up to date ( i should probably deal with this for SDL as i am
always using
it :wink: ) and the bloodshed devc++ IDE is no longer active and as a few minor
bugs, but they rearely affect productrivity too much.

All the more reason to stay away from it. Lots of people survive
fine without IDEs… :-)–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Bill Kendrick wrote:

No. You #include “SDL.h”. And if ‘sdl-config’ is unavailable, or unusable
in your build environment, just make sure that you add the path to the SDL
headers to your build system’s header path. (e.g., with GCC you’d
do an “-I” to add an additional include path)

That’s the most portable way.
Guess I’ll do that. :stuck_out_tongue:

sdl-config is only used with
commandline environments.
I am on a commandline environment… xD

i find the simplest way to get using SDL in the windows is to use
bloodshed dev
c++ which has progect packages for SDL so you can download them easilly and
then all you need is a list like
I used that once; I didn’t like it, but I don’t remember why… Probably
’cause I was a noob and didn’t know how to use it. :@

Not really very good advice. Experienced coders will go for
configuration files: autoconf, Makefile or whatever VC has.
Go GNU Make! :smiley:
Here’s something I don’t understand though, maybe you can fill me in -
what exactly are autoconf and ./configure for? I know it generates the
Makefile, I always write mine by hand… o_O

Thanks y’all for your replies!!

Oh, and I just realized why sdl-config wasn’t working… I was on
Windows’ cmd.exe while I should have been using MSYS. :stuck_out_tongue:

Quoting KHMan :

neil at cloudsprinter.com wrote:

What Win32 compiler do you use ?

i find the simplest way to get using SDL in the windows is to use
bloodshed dev
c++ which has progect packages for SDL so you can download them easilly and
then all you need is a list like
-lmingw32
[snip]
in the progect option -> parameters - linker window

Not really very good advice. Experienced coders …

i find doing anything other than downloading spyware and viruses really
hard in
windows, i still do all my debugging and stuff in linux land, but when i am
stuck with doze devcpp easiest way to get up and running… :stuck_out_tongue: i can have my
entirte IDE and all the files i need on a usb stick and it just works of the
pen… i have attempted to set up different environments for programming on the
doze, but it just sux too much… and as a user who hates all this setup
configue this point to that link this you didnt type that frolocks, all i’m
saying is that is the best way to get into doing the sdl on the doze :stuck_out_tongue:
when my
code is finished i will use a cross compiler in linux land to make the binary.

i mean why the fonze cant it just be frikkin easy to start using c and
programming, for some reason it isnt it’s a complete beach, unless use use an
IDE that has everything setup for you, or just about…

sorry, i’m a lazy human, i like IDE’s, i like not having to trawl through some
command line or really nasty implementation of a filesystem to get things
going… if your setting out in c it sucks… it sucks bad… first you gotta get
your head round the frikkin language then you wanna code something and you
gotta script this bingle that tweak your niplles and whatever else :wink:

and its always very easy for experienced people to say how simple it is to use
this script that bingle just flange it over there, but when you dont
know jack,
you dont know jack… like most linux documentation… you are assumed
you already
know who jack is and all about jack his mother father sister and
cousins, but if
you dont know jack what a jill is or anything about any hills then you just
stuck, it’s like noone wants things to be simple

ok i’ll shut up now

no, i’m not drunk :wink:

L-28C wrote:

Bill Kendrick wrote:

No. You #include “SDL.h”. And if ‘sdl-config’ is unavailable, or unusable
in your build environment, just make sure that you add the path to the SDL
headers to your build system’s header path. (e.g., with GCC you’d
do an “-I” to add an additional include path)
[snip]

i find the simplest way to get using SDL in the windows is to use
bloodshed dev
c++ which has progect packages for SDL so you can download them easilly and
then all you need is a list like
I used that once; I didn’t like it, but I don’t remember why… Probably
’cause I was a noob and didn’t know how to use it. :@

Not really very good advice. Experienced coders will go for
configuration files: autoconf, Makefile or whatever VC has.
Go GNU Make! :smiley:
Here’s something I don’t understand though, maybe you can fill me in -
what exactly are autoconf and ./configure for? I know it generates the
Makefile, I always write mine by hand… o_O

The best intro that I have read:
http://sourceware.org/autobook/

The manuals for autoconf and friends are very comprehensive as
well, if you don’t mind reading reference texts. It is best to
browse them entirely after reading the intro texts.

For Win32 refugees (I am one myself) seeking alternatives, I think
we tend to write Makefiles, at least in the beginning. It has the
lowest knowledge and adoption barrier. But if you want to hack at
many FLOSS projects, some knowledge of the autotools is handy.

HTH,–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

neil at cloudsprinter.com wrote:

Quoting KHMan <@Kein-Hong_Man>:

neil at cloudsprinter.com wrote:

What Win32 compiler do you use ?
i find the simplest way to get using SDL in the windows is to use
bloodshed dev
c++ which has progect packages for SDL so you can download them easilly and
then all you need is a list like
-lmingw32
[snip]
in the progect option -> parameters - linker window
Not really very good advice. Experienced coders …

i find doing anything other than downloading spyware and viruses really
hard in
windows, i still do all my debugging and stuff in linux land, but when i am
stuck with doze devcpp easiest way to get up and running… :stuck_out_tongue: i can have my
entirte IDE and all the files i need on a usb stick and it just works of the
pen… i have attempted to set up different environments for programming on the
doze, but it just sux too much… and as a user who hates all this setup
configue this point to that link this you didnt type that frolocks, all i’m
saying is that is the best way to get into doing the sdl on the doze :stuck_out_tongue:
when my
code is finished i will use a cross compiler in linux land to make the binary.

Very strange coming from a Linux user. :slight_smile: I would expect you to
be recommending MinGW/Msys or Cygwin. Staying on command-line
tools and a standard editor between platforms requires a lower
cognitive effort. No code to adjust, no dialog boxes to click.
Just move the project files, then fire off a few commands. Easy.

i mean why the fonze cant it just be frikkin easy to start using c and
programming, for some reason it isnt it’s a complete beach, unless use use an
IDE that has everything setup for you, or just about…

I dunno, what’s harder than untarring, then “./configure” and
"make"? Or writing primitive Makefiles?

[snip]
ok i’ll shut up now

As I have observed, very strange, coming from a Linux user.
Anyway, this has gone on long enough, so let us end this thread. I
won’t comment further.–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Very strange coming from a Linux user. :slight_smile:

i’m a computer user, no specific platform… i would be using RISC OS as it is
the only operating statem to have a sane fileing system, but even then the c
tools are a bit sucky for someone like me that just wants things to happen,
there you have to use makefiles as i dont think any form of auto whatver for
the version of gcc it uses have bee ported built. but at leat the GUI and
filesystem is sane.

I dunno, what’s harder than untarring, then “./configure” and
"make"? Or writing primitive Makefiles?

admittedly i havnt tried to use autoconfigure or anything for my
progects since
about 5-6 years ago, and then i probably didnt try hard enough, but my 16 file
c programs dont really merit using something that really just makes it more
complicated than is nessecary

[snip]
ok i’ll shut up now

As I have observed, very strange, coming from a Linux user.

very strange generally, i still hate all the messing around in linux or on any
computer system, seems we are owned by technology, simple and easy to use has
been obstificated (wtw?) by too many options trying to be too clever, so the
techology owns us. when you spend 3 days trying to configure something to how
you want it, you have to wonder why bother…