No available video device on static link

Hi I’ve searched the newsgroup intesivelly but all the treads with this problem
are not answered (strange).

My game was working fine but I decided to link SDL statically and now I
get: “No available video device” on my Init.

I plan to make all my source available so there should not be any problems with
the licence!

Could someone help?

Bas van Dijk <bas.van.dijk zonnet.nl> writes:

BTW I am trying this on windows!

ANY ideas are welcome (I am at a loss):

Did anyone ever try to link SDL statically? How does it work? Is there a Howto
somewhere? Can it even be done?

I would like to create a single exe with all stuff inside it (see my
previous post).

This is a simple and small game (my first serious attempt). The main reasons
for me wanting to link statically are:

  • Easy distribution, no hassle about ‘lost files’ and dll’s. It has to ‘just
    work’
  • No install stuff or unzipping, just download (under 1 Mb) and play!
  • Personal opinion: I just like the idea of a single exe doing all the work
  • This approach is new to me and I want to make this idea work and learn
    from the experiance

In my opinion it’s a freaking nightmare to link stuff statically (even more
challenging :wink: but I’ve come this far so I’ll finish it!

I found out that the DLL version finds a video device because ENABLE_DIRECTX
was defined somehow (I don’t have a clue where it is being defined, but it
looks like it is) and my static lib does not have this compiler directive
defined, so no bootstrap, no video device, right???.

Any ideas? I’m realy stuck here

Thanks,

Bas van Dijk

BTW, I’m on SDL 1.1.6 and doing this on winXP

First thing I would do is try using a newer version of SDL. I think
1.2.7 is the current one, that’s what I’m using right now. If that
doesn’t help with the stated problem, try #defining ENABLE_DIRECTX
somewhere in your program headers and see if that helps.

-JustinOn Mon, 4 Oct 2004 19:06:39 +0000 (UTC), Bas van Dijk <bas.van.dijk at zonnet.nl> wrote:

I found out that the DLL version finds a video device because ENABLE_DIRECTX
was defined somehow (I don’t have a clue where it is being defined, but it
looks like it is) and my static lib does not have this compiler directive
defined, so no bootstrap, no video device, right???.

BTW, I’m on SDL 1.1.6 and doing this on winXP

I wrote an little howto for a small game I did. It explains step by step
how to build a statically linked exe using mingw and msys.

http://www.boardmod.org/stuff/astro_constrib.tar.gz

Best Regards,
Michael Prager

Bas van Dijk wrote:>ANY ideas are welcome (I am at a loss):

Did anyone ever try to link SDL statically? How does it work? Is there a Howto
somewhere? Can it even be done?

I would like to create a single exe with all stuff inside it (see my
previous post).

This is a simple and small game (my first serious attempt). The main reasons
for me wanting to link statically are:

  • Easy distribution, no hassle about ‘lost files’ and dll’s. It has to ‘just
    work’
  • No install stuff or unzipping, just download (under 1 Mb) and play!
  • Personal opinion: I just like the idea of a single exe doing all the work
  • This approach is new to me and I want to make this idea work and learn
    from the experiance

In my opinion it’s a freaking nightmare to link stuff statically (even more
challenging :wink: but I’ve come this far so I’ll finish it!

I found out that the DLL version finds a video device because ENABLE_DIRECTX
was defined somehow (I don’t have a clue where it is being defined, but it
looks like it is) and my static lib does not have this compiler directive
defined, so no bootstrap, no video device, right???.

Any ideas? I’m realy stuck here

Thanks,

Bas van Dijk

BTW, I’m on SDL 1.1.6 and doing this on winXP


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Bas van Dijk <bas.van.dijk zonnet.nl> writes:

I found out that the DLL version finds a video device because ENABLE_DIRECTX
was defined somehow (I don’t have a clue where it is being defined, but it
looks like it is) and my static lib does not have this compiler directive
defined, so no bootstrap, no video device, right???.

So, now I understand why nobody replied… But for all those idiots out there
with the same IQ (lower will be difficult) as me:

I solved it myself after 5 days of intensive SDL source investigation… Of
course there was nothing wrong with the source (however I did find some
interesting comments).

I forgot to define ENABLE_DIRECTX (and some other stuff) as a preprocessor
definition!!!

greetz,

Bas van Dijk