Getting Started with SDL2

Hi all, I just signed up to this list.

Having used SDL some year ago, from the 1.2 branch, I wanted to take the
new 2.0 RC for a spin but I’m having a tough time. I hope I’m not missing
something obvious, but I’ve been unable to find a simple "getting started"
doc about this version. I’m not saying a full-on tutorial, just what kind
of VisualStudio / Xcode project should be used and what to link in which
order, that’s all.

I first started with Xcode because my work box is a Mac, downloading the
2.0RC development package. Besides the SDL2.framework there’s also a
"devel-lite" directory with a textfile with outdated? information regarding
non-existant SDLMain.a files and whatnot. It seems those files are no
longer required? Should I make a Cocoa or Console app? Tried with Cocoa,
removed all files and created a simple main.cpp, but got a linker error
stating that it couldn’t find the SDL2 framework I just linked to the
project…

There’s also a bunch of old SDL 1.3 / pre-RC 2 Xcode templates that seem
abandoned now, none of them ran out of the box neither. README-macosx.txt
on HG seems to be about the 1.2 branch still.

Then I tried on Windows 7 with VS 2012, since Windows is usually better
supported for these things. I used the following article as a guide:
http://twinklebeardev.blogspot.com.ar/2012/07/setting-up-sdl-in-visual-studio.html.
Seems to be the same process I remember from years ago, I just replaced
references to SDLMain.lib and SDL.lib with SDL2Main.lib and SDL2.lib.
Compiled and linked successfully, but it doesn’t run: “The application was
unable to start correctly (random hex error code)”. I’m not even calling
any SDL api in it, main() just returns zero.

Old SDL code included SDL.g like this <SDL/SDL.h> and declared main like
this: int main(int argc, char** argv). I remember this being quite
important back in the old 1.2 days. Now there are some tutorials that use
that format, yet the SDL wiki just declares int main() and includes “SDL.h”
(the include folder seems to have lost its former SDL directory too.

I’m almost sure that I’m missing stuff, but right now getting information
on how to build a simple SDL application seems to be very difficult. I know
I’m not talking about a mature, final release, but having an RC out and not
having a simple readme on how to use the lib seems very weird to me.

I’m sorry if this message come out a little rude, it’s not my intention.
But english isn’t my native tongue and I’m a little frustrated right now.

I’d like to gather the basic information needed to build a simple SDL2
"Hello World" and even put it in a website / wiki myself if necessary :slight_smile:

Cheers,

Thanks for the feedback!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.

The Visual Studio example that you did should work out of the box. That
hex error code usually means there’s a missing DLL or conflict of some
kind. There’s a tool you can grab that can help diagnose these, just drop
your executable onto it:
http://www.dependencywalker.com/

It sounds like we could use a set of simple “Hello World” tutorial videos,
one for each supported platform. In my experience, building the projects
and testing on all the platforms is one of the bigger hurdles when starting
to use SDL.

Thoughts?On Sun, Jun 9, 2013 at 7:25 PM, Iv?n Vodopiviz wrote:

Hi all, I just signed up to this list.

Having used SDL some year ago, from the 1.2 branch, I wanted to take the
new 2.0 RC for a spin but I’m having a tough time. I hope I’m not missing
something obvious, but I’ve been unable to find a simple "getting started"
doc about this version. I’m not saying a full-on tutorial, just what kind
of VisualStudio / Xcode project should be used and what to link in which
order, that’s all.

I first started with Xcode because my work box is a Mac, downloading the
2.0RC development package. Besides the SDL2.framework there’s also a
"devel-lite" directory with a textfile with outdated? information regarding
non-existant SDLMain.a files and whatnot. It seems those files are no
longer required? Should I make a Cocoa or Console app? Tried with Cocoa,
removed all files and created a simple main.cpp, but got a linker error
stating that it couldn’t find the SDL2 framework I just linked to the
project…

There’s also a bunch of old SDL 1.3 / pre-RC 2 Xcode templates that seem
abandoned now, none of them ran out of the box neither. README-macosx.txt
on HG seems to be about the 1.2 branch still.

Then I tried on Windows 7 with VS 2012, since Windows is usually better
supported for these things. I used the following article as a guide:
http://twinklebeardev.blogspot.com.ar/2012/07/setting-up-sdl-in-visual-studio.html.
Seems to be the same process I remember from years ago, I just replaced
references to SDLMain.lib and SDL.lib with SDL2Main.lib and SDL2.lib.
Compiled and linked successfully, but it doesn’t run: “The application was
unable to start correctly (random hex error code)”. I’m not even calling
any SDL api in it, main() just returns zero.

Old SDL code included SDL.g like this <SDL/SDL.h> and declared main like
this: int main(int argc, char** argv). I remember this being quite
important back in the old 1.2 days. Now there are some tutorials that use
that format, yet the SDL wiki just declares int main() and includes “SDL.h”
(the include folder seems to have lost its former SDL directory too.

I’m almost sure that I’m missing stuff, but right now getting information
on how to build a simple SDL application seems to be very difficult. I know
I’m not talking about a mature, final release, but having an RC out and not
having a simple readme on how to use the lib seems very weird to me.

I’m sorry if this message come out a little rude, it’s not my intention.
But english isn’t my native tongue and I’m a little frustrated right now.

I’d like to gather the basic information needed to build a simple SDL2
"Hello World" and even put it in a website / wiki myself if necessary :slight_smile:

Cheers,


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

Hi Sam!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.
Much appreciated! Thanks!

The Visual Studio example that you did should work out of the box. That
hex error code usually means there’s a missing DLL or conflict of some
kind. There’s a tool you can grab that can help diagnose these, just drop

your executable onto it:
http://www.dependencywalker.com/
The weird thing is that I always perform a first run without copying any
dlls to my execution directory and when I first tried the program correctly
complained about not finding SDL’s dll. As a quick test, I copied the dll
packaged with the 2.0RC to my debug directory and that error went away. One
thing I didn’t check was either VS2012 generates a 32 or 64 bit app by
default, maybe that’s causing issues? I’ll investigate later this night.

It sounds like we could use a set of simple “Hello World” tutorial
videos, one for each supported platform. In my experience, building the
projects and testing on all the platforms is one of the bigger hurdles when
starting >> to use SDL.
Sounds about right, even though I’m not very fond of video tutorials. I was
able to build a simple application (the RenderPresent example from the
wiki) on my Mac a few minutes ago so it seems I finally got that right. I’d
write a small tutorials and host it on my site… if I had one, heh.

Cheers,On Mon, Jun 10, 2013 at 1:30 PM, Sam Lantinga wrote:

Thanks for the feedback!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.

The Visual Studio example that you did should work out of the box. That
hex error code usually means there’s a missing DLL or conflict of some
kind. There’s a tool you can grab that can help diagnose these, just drop
your executable onto it:
http://www.dependencywalker.com/

It sounds like we could use a set of simple “Hello World” tutorial videos,
one for each supported platform. In my experience, building the projects
and testing on all the platforms is one of the bigger hurdles when starting
to use SDL.

Thoughts?

On Sun, Jun 9, 2013 at 7:25 PM, Iv?n Vodopiviz wrote:

Hi all, I just signed up to this list.

Having used SDL some year ago, from the 1.2 branch, I wanted to take the
new 2.0 RC for a spin but I’m having a tough time. I hope I’m not missing
something obvious, but I’ve been unable to find a simple "getting started"
doc about this version. I’m not saying a full-on tutorial, just what kind
of VisualStudio / Xcode project should be used and what to link in which
order, that’s all.

I first started with Xcode because my work box is a Mac, downloading the
2.0RC development package. Besides the SDL2.framework there’s also a
"devel-lite" directory with a textfile with outdated? information regarding
non-existant SDLMain.a files and whatnot. It seems those files are no
longer required? Should I make a Cocoa or Console app? Tried with Cocoa,
removed all files and created a simple main.cpp, but got a linker error
stating that it couldn’t find the SDL2 framework I just linked to the
project…

There’s also a bunch of old SDL 1.3 / pre-RC 2 Xcode templates that seem
abandoned now, none of them ran out of the box neither. README-macosx.txt
on HG seems to be about the 1.2 branch still.

Then I tried on Windows 7 with VS 2012, since Windows is usually better
supported for these things. I used the following article as a guide:
http://twinklebeardev.blogspot.com.ar/2012/07/setting-up-sdl-in-visual-studio.html.
Seems to be the same process I remember from years ago, I just replaced
references to SDLMain.lib and SDL.lib with SDL2Main.lib and SDL2.lib.
Compiled and linked successfully, but it doesn’t run: “The application was
unable to start correctly (random hex error code)”. I’m not even calling
any SDL api in it, main() just returns zero.

Old SDL code included SDL.g like this <SDL/SDL.h> and declared main like
this: int main(int argc, char** argv). I remember this being quite
important back in the old 1.2 days. Now there are some tutorials that use
that format, yet the SDL wiki just declares int main() and includes “SDL.h”
(the include folder seems to have lost its former SDL directory too.

I’m almost sure that I’m missing stuff, but right now getting information
on how to build a simple SDL application seems to be very difficult. I know
I’m not talking about a mature, final release, but having an RC out and not
having a simple readme on how to use the lib seems very weird to me.

I’m sorry if this message come out a little rude, it’s not my intention.
But english isn’t my native tongue and I’m a little frustrated right now.

I’d like to gather the basic information needed to build a simple SDL2
"Hello World" and even put it in a website / wiki myself if necessary :slight_smile:

Cheers,


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


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

You’re more than welcome to add to the SDL wiki, just send me your desired
username and password and I’ll hook you up.

See ya!On Mon, Jun 10, 2013 at 9:42 AM, Iv?n Vodopiviz wrote:

Hi Sam!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.
Much appreciated! Thanks!

The Visual Studio example that you did should work out of the box.
That hex error code usually means there’s a missing DLL or conflict of
some kind. There’s a tool you can grab that can help diagnose these, just
drop >> your executable onto it:

http://www.dependencywalker.com/
The weird thing is that I always perform a first run without copying any
dlls to my execution directory and when I first tried the program correctly
complained about not finding SDL’s dll. As a quick test, I copied the dll
packaged with the 2.0RC to my debug directory and that error went away. One
thing I didn’t check was either VS2012 generates a 32 or 64 bit app by
default, maybe that’s causing issues? I’ll investigate later this night.

It sounds like we could use a set of simple “Hello World” tutorial
videos, one for each supported platform. In my experience, building the
projects and testing on all the platforms is one of the bigger hurdles when
starting >> to use SDL.
Sounds about right, even though I’m not very fond of video tutorials. I
was able to build a simple application (the RenderPresent example from the
wiki) on my Mac a few minutes ago so it seems I finally got that right. I’d
write a small tutorials and host it on my site… if I had one, heh.

Cheers,

On Mon, Jun 10, 2013 at 1:30 PM, Sam Lantinga <@slouken> wrote:

Thanks for the feedback!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.

The Visual Studio example that you did should work out of the box. That
hex error code usually means there’s a missing DLL or conflict of some
kind. There’s a tool you can grab that can help diagnose these, just drop
your executable onto it:
http://www.dependencywalker.com/

It sounds like we could use a set of simple “Hello World” tutorial
videos, one for each supported platform. In my experience, building the
projects and testing on all the platforms is one of the bigger hurdles when
starting to use SDL.

Thoughts?

On Sun, Jun 9, 2013 at 7:25 PM, Iv?n Vodopiviz wrote:

Hi all, I just signed up to this list.

Having used SDL some year ago, from the 1.2 branch, I wanted to take the
new 2.0 RC for a spin but I’m having a tough time. I hope I’m not missing
something obvious, but I’ve been unable to find a simple "getting started"
doc about this version. I’m not saying a full-on tutorial, just what kind
of VisualStudio / Xcode project should be used and what to link in which
order, that’s all.

I first started with Xcode because my work box is a Mac, downloading the
2.0RC development package. Besides the SDL2.framework there’s also a
"devel-lite" directory with a textfile with outdated? information regarding
non-existant SDLMain.a files and whatnot. It seems those files are no
longer required? Should I make a Cocoa or Console app? Tried with Cocoa,
removed all files and created a simple main.cpp, but got a linker error
stating that it couldn’t find the SDL2 framework I just linked to the
project…

There’s also a bunch of old SDL 1.3 / pre-RC 2 Xcode templates that seem
abandoned now, none of them ran out of the box neither. README-macosx.txt
on HG seems to be about the 1.2 branch still.

Then I tried on Windows 7 with VS 2012, since Windows is usually better
supported for these things. I used the following article as a guide:
http://twinklebeardev.blogspot.com.ar/2012/07/setting-up-sdl-in-visual-studio.html.
Seems to be the same process I remember from years ago, I just replaced
references to SDLMain.lib and SDL.lib with SDL2Main.lib and SDL2.lib.
Compiled and linked successfully, but it doesn’t run: “The application was
unable to start correctly (random hex error code)”. I’m not even calling
any SDL api in it, main() just returns zero.

Old SDL code included SDL.g like this <SDL/SDL.h> and declared main like
this: int main(int argc, char** argv). I remember this being quite
important back in the old 1.2 days. Now there are some tutorials that use
that format, yet the SDL wiki just declares int main() and includes “SDL.h”
(the include folder seems to have lost its former SDL directory too.

I’m almost sure that I’m missing stuff, but right now getting
information on how to build a simple SDL application seems to be very
difficult. I know I’m not talking about a mature, final release, but having
an RC out and not having a simple readme on how to use the lib seems very
weird to me.

I’m sorry if this message come out a little rude, it’s not my intention.
But english isn’t my native tongue and I’m a little frustrated right now.

I’d like to gather the basic information needed to build a simple SDL2
"Hello World" and even put it in a website / wiki myself if necessary :slight_smile:

Cheers,


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


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


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

Better late than never: Indeed I had mixed up my x86 build with an x64 dll,
everything seems to work now. I feel kinda dumb. The only difference right
now between my Mac and Win versions is the way I include SDL.h, but that’s
trivial.

I’ll see if I can put some instructions together so you can have a look
before putting it on the official wiki.

Cheers,On Mon, Jun 10, 2013 at 1:43 PM, Sam Lantinga wrote:

You’re more than welcome to add to the SDL wiki, just send me your desired
username and password and I’ll hook you up.

See ya!

On Mon, Jun 10, 2013 at 9:42 AM, Iv?n Vodopiviz wrote:

Hi Sam!

I will go through and remove all the old Xcode templates and work up
a simple example using the SDL framework.
Much appreciated! Thanks!

The Visual Studio example that you did should work out of the box.
That hex error code usually means there’s a missing DLL or conflict of
some kind. There’s a tool you can grab that can help diagnose these, just
drop >> your executable onto it:

http://www.dependencywalker.com/
The weird thing is that I always perform a first run without copying any
dlls to my execution directory and when I first tried the program correctly
complained about not finding SDL’s dll. As a quick test, I copied the dll
packaged with the 2.0RC to my debug directory and that error went away. One
thing I didn’t check was either VS2012 generates a 32 or 64 bit app by
default, maybe that’s causing issues? I’ll investigate later this night.

It sounds like we could use a set of simple “Hello World” tutorial
videos, one for each supported platform. In my experience, building the
projects and testing on all the platforms is one of the bigger hurdles when
starting >> to use SDL.
Sounds about right, even though I’m not very fond of video tutorials. I
was able to build a simple application (the RenderPresent example from the
wiki) on my Mac a few minutes ago so it seems I finally got that right. I’d
write a small tutorials and host it on my site… if I had one, heh.

Cheers,

On Mon, Jun 10, 2013 at 1:30 PM, Sam Lantinga wrote:

Thanks for the feedback!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.

The Visual Studio example that you did should work out of the box. That
hex error code usually means there’s a missing DLL or conflict of some
kind. There’s a tool you can grab that can help diagnose these, just drop
your executable onto it:
http://www.dependencywalker.com/

It sounds like we could use a set of simple “Hello World” tutorial
videos, one for each supported platform. In my experience, building the
projects and testing on all the platforms is one of the bigger hurdles when
starting to use SDL.

Thoughts?

On Sun, Jun 9, 2013 at 7:25 PM, Iv?n Vodopiviz wrote:

Hi all, I just signed up to this list.

Having used SDL some year ago, from the 1.2 branch, I wanted to take
the new 2.0 RC for a spin but I’m having a tough time. I hope I’m not
missing something obvious, but I’ve been unable to find a simple “getting
started” doc about this version. I’m not saying a full-on tutorial, just
what kind of VisualStudio / Xcode project should be used and what to link
in which order, that’s all.

I first started with Xcode because my work box is a Mac, downloading
the 2.0RC development package. Besides the SDL2.framework there’s also a
"devel-lite" directory with a textfile with outdated? information regarding
non-existant SDLMain.a files and whatnot. It seems those files are no
longer required? Should I make a Cocoa or Console app? Tried with Cocoa,
removed all files and created a simple main.cpp, but got a linker error
stating that it couldn’t find the SDL2 framework I just linked to the
project…

There’s also a bunch of old SDL 1.3 / pre-RC 2 Xcode templates that
seem abandoned now, none of them ran out of the box
neither. README-macosx.txt on HG seems to be about the 1.2 branch still.

Then I tried on Windows 7 with VS 2012, since Windows is usually better
supported for these things. I used the following article as a guide:
http://twinklebeardev.blogspot.com.ar/2012/07/setting-up-sdl-in-visual-studio.html.
Seems to be the same process I remember from years ago, I just replaced
references to SDLMain.lib and SDL.lib with SDL2Main.lib and SDL2.lib.
Compiled and linked successfully, but it doesn’t run: “The application was
unable to start correctly (random hex error code)”. I’m not even calling
any SDL api in it, main() just returns zero.

Old SDL code included SDL.g like this <SDL/SDL.h> and declared main
like this: int main(int argc, char** argv). I remember this being quite
important back in the old 1.2 days. Now there are some tutorials that use
that format, yet the SDL wiki just declares int main() and includes “SDL.h”
(the include folder seems to have lost its former SDL directory too.

I’m almost sure that I’m missing stuff, but right now getting
information on how to build a simple SDL application seems to be very
difficult. I know I’m not talking about a mature, final release, but having
an RC out and not having a simple readme on how to use the lib seems very
weird to me.

I’m sorry if this message come out a little rude, it’s not my
intention. But english isn’t my native tongue and I’m a little frustrated
right now.

I’d like to gather the basic information needed to build a simple SDL2
"Hello World" and even put it in a website / wiki myself if necessary :slight_smile:

Cheers,


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


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


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


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

Okay, I removed the old Xcode templates in the latest RC build.

Cheers!On Mon, Jun 10, 2013 at 9:30 AM, Sam Lantinga <@slouken> wrote:

Thanks for the feedback!

I will go through and remove all the old Xcode templates and work up a
simple example using the SDL framework.

The Visual Studio example that you did should work out of the box. That
hex error code usually means there’s a missing DLL or conflict of some
kind. There’s a tool you can grab that can help diagnose these, just drop
your executable onto it:
http://www.dependencywalker.com/

It sounds like we could use a set of simple “Hello World” tutorial videos,
one for each supported platform. In my experience, building the projects
and testing on all the platforms is one of the bigger hurdles when starting
to use SDL.

Thoughts?

On Sun, Jun 9, 2013 at 7:25 PM, Iv?n Vodopiviz wrote:

Hi all, I just signed up to this list.

Having used SDL some year ago, from the 1.2 branch, I wanted to take the
new 2.0 RC for a spin but I’m having a tough time. I hope I’m not missing
something obvious, but I’ve been unable to find a simple "getting started"
doc about this version. I’m not saying a full-on tutorial, just what kind
of VisualStudio / Xcode project should be used and what to link in which
order, that’s all.

I first started with Xcode because my work box is a Mac, downloading the
2.0RC development package. Besides the SDL2.framework there’s also a
"devel-lite" directory with a textfile with outdated? information regarding
non-existant SDLMain.a files and whatnot. It seems those files are no
longer required? Should I make a Cocoa or Console app? Tried with Cocoa,
removed all files and created a simple main.cpp, but got a linker error
stating that it couldn’t find the SDL2 framework I just linked to the
project…

There’s also a bunch of old SDL 1.3 / pre-RC 2 Xcode templates that seem
abandoned now, none of them ran out of the box neither. README-macosx.txt
on HG seems to be about the 1.2 branch still.

Then I tried on Windows 7 with VS 2012, since Windows is usually better
supported for these things. I used the following article as a guide:
http://twinklebeardev.blogspot.com.ar/2012/07/setting-up-sdl-in-visual-studio.html.
Seems to be the same process I remember from years ago, I just replaced
references to SDLMain.lib and SDL.lib with SDL2Main.lib and SDL2.lib.
Compiled and linked successfully, but it doesn’t run: “The application was
unable to start correctly (random hex error code)”. I’m not even calling
any SDL api in it, main() just returns zero.

Old SDL code included SDL.g like this <SDL/SDL.h> and declared main like
this: int main(int argc, char** argv). I remember this being quite
important back in the old 1.2 days. Now there are some tutorials that use
that format, yet the SDL wiki just declares int main() and includes “SDL.h”
(the include folder seems to have lost its former SDL directory too.

I’m almost sure that I’m missing stuff, but right now getting information
on how to build a simple SDL application seems to be very difficult. I know
I’m not talking about a mature, final release, but having an RC out and not
having a simple readme on how to use the lib seems very weird to me.

I’m sorry if this message come out a little rude, it’s not my intention.
But english isn’t my native tongue and I’m a little frustrated right now.

I’d like to gather the basic information needed to build a simple SDL2
"Hello World" and even put it in a website / wiki myself if necessary :slight_smile:

Cheers,


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