Problem : undefined symbol: DPMSDisable

Hello =)

I have a problem with SDL… Here is my code, in D Language (but it
does not change anything with C++… ) :

void init()
{
DerelictSDL.load();

assert((SDL_Init(SDL_INIT_VIDEO) < 0), ("Unable to init SDL : " ~
SDL_GetDError()));

assert((SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE|SDL_DOUBLEBUF) is
null), ("Unable to set SDL_VideoMode : " ~ SDL_GetDError()));
}

I compile nice, but when i run the program :

Unable to init SDL : Failed loading DPMSDisable: /usr/lib/libX11.so.6:
undefined symbol: DPMSDisable

:-/

Can someone help me to fix it ?

Thank you in Advance.
Insomniak.

Hello =)

I have a problem with SDL… Here is my code, in D Language (but it
does not change anything with C++… ) :

void init()
{
DerelictSDL.load();

assert((SDL_Init(SDL_INIT_VIDEO) < 0), ("Unable to init SDL : " ~
SDL_GetDError()));

assert((SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE|SDL_DOUBLEBUF) is
null), ("Unable to set SDL_VideoMode : " ~ SDL_GetDError()));
}

I compile nice, but when i run the program :

Unable to init SDL : Failed loading DPMSDisable: /usr/lib/libX11.so.6:
undefined symbol: DPMSDisable

:-/

Can someone help me to fix it ?

you need to find where DPMSDisable comes from. try something like:

$ cd /usr/X11R6/lib
$ grep DPMSDisable *
Binary file libXext.so.10.0 matches
$

so, in this case, DPMSDisable is probably in libXext.so.10.0, let’s
check:

$ nm libXext.so.10.0 | grep DPMSDisable
00003ed0 T DPMSDiable
$

which, according to my nm manual, means DPMSDisable is a text
segment symbol with a value of 00003ed0.

so, to provide this symbol, DPMSDisable, I would have to also link
in libXext.

Thank you in Advance.

hope that helped.On Sat, Sep 15, 2007 at 02:59:32PM +0200, Gael Goinvic wrote:


@Jacob_Meuser
SDF Public Access UNIX System - http://sdf.lonestar.org

2007/9/15, Jacob Meuser :> On Sat, Sep 15, 2007 at 02:59:32PM +0200, Gael Goinvic wrote:

Hello =)

I have a problem with SDL… Here is my code, in D Language (but it
does not change anything with C++… ) :

void init()
{
DerelictSDL.load();

assert((SDL_Init(SDL_INIT_VIDEO) < 0), ("Unable to init SDL : " ~
SDL_GetDError()));

assert((SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE|SDL_DOUBLEBUF) is
null), ("Unable to set SDL_VideoMode : " ~ SDL_GetDError()));
}

I compile nice, but when i run the program :

Unable to init SDL : Failed loading DPMSDisable: /usr/lib/libX11.so.6:
undefined symbol: DPMSDisable

:-/

Can someone help me to fix it ?

you need to find where DPMSDisable comes from. try something like:

$ cd /usr/X11R6/lib
$ grep DPMSDisable *
Binary file libXext.so.10.0 matches
$

so, in this case, DPMSDisable is probably in libXext.so.10.0, let’s
check:

$ nm libXext.so.10.0 | grep DPMSDisable
00003ed0 T DPMSDiable
$

which, according to my nm manual, means DPMSDisable is a text
segment symbol with a value of 00003ed0.

so, to provide this symbol, DPMSDisable, I would have to also link
in libXext.

Thank you in Advance.

hope that helped.


jakemsr at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org


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

MMmh… I have found where DPMSDisable come from, it’s in libXext.a.
So, i link Xext by typing this :

gael at Kubuntu:-$ rebuild main.d -L-lXext -clean
gcc ./_main.o ./detris.engine.o ./nmd_gcstats.o ./detris.defines.o -o
main -m32 -Xlinker --start-group -lphobos -lSDD-derelict-sdl
-lSDD-derelict-util -ldl -lSDD-derelict-util -lXext -lphobos -lpthread
-lm

But i still get the error… :frowning:

Gael Goinvic wrote:

2007/9/15, Jacob Meuser :

Hello =)

I have a problem with SDL… Here is my code, in D Language (but it
does not change anything with C++… ) :

void init()
{
DerelictSDL.load();

assert((SDL_Init(SDL_INIT_VIDEO) < 0), ("Unable to init SDL : " ~
SDL_GetDError()));

assert((SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE|SDL_DOUBLEBUF) is
null), ("Unable to set SDL_VideoMode : " ~ SDL_GetDError()));
}

I compile nice, but when i run the program :

Unable to init SDL : Failed loading DPMSDisable: /usr/lib/libX11.so.6:
undefined symbol: DPMSDisable

:-/

Can someone help me to fix it ?

you need to find where DPMSDisable comes from. try something like:

$ cd /usr/X11R6/lib
$ grep DPMSDisable *
Binary file libXext.so.10.0 matches
$

so, in this case, DPMSDisable is probably in libXext.so.10.0, let’s
check:

$ nm libXext.so.10.0 | grep DPMSDisable
00003ed0 T DPMSDiable
$

which, according to my nm manual, means DPMSDisable is a text
segment symbol with a value of 00003ed0.

so, to provide this symbol, DPMSDisable, I would have to also link
in libXext.

Thank you in Advance.

hope that helped.


jakemsr at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org


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

MMmh… I have found where DPMSDisable come from, it’s in libXext.a.
So, i link Xext by typing this :

gael at Kubuntu:-$ rebuild main.d -L-lXext -clean
gcc ./_main.o ./detris.engine.o ./nmd_gcstats.o ./detris.defines.o -o
main -m32 -Xlinker --start-group -lphobos -lSDD-derelict-sdl
-lSDD-derelict-util -ldl -lSDD-derelict-util -lXext -lphobos -lpthread
-lm

But i still get the error… :frowning:


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

Try checking the header files you are including to make sure that the
function is being declared.>> On Sat, Sep 15, 2007 at 02:59:32PM +0200, Gael Goinvic wrote:

assert((SDL_Init(SDL_INIT_VIDEO) < 0), ("Unable to init SDL : " ~
SDL_GetDError()));

You are asserting that SDL_Init() failed, right? You’re basically saying:

if (SDL_Init() doesn’t report failure) { abort(“Unable to init…”); }

So that should be:

 assert((SDL_Init(SDL_INIT_VIDEO) == 0), "Unable to...")

SDL_Init() returning -1 means it failed.

Unable to init SDL : Failed loading DPMSDisable: /usr/lib/libX11.so.6:
undefined symbol: DPMSDisable

This is an error message that the X11 target generates when loading
non-essential symbols (even though ultimately everything works out).
Everything up to SDL 1.2.12 will report this if you ask for the last
error message after SDL_Init() when SDL_Init() didn’t actually fail. We
have fixed this in Subversion to clear the error message if all the
essential symbols are found to reduce unnecessary bug reports.

Fix your assertion, though, and your problem should go away.

–ryan.

Thank you, you are right =)

It’s the first time i use assert errors, so, excuse me for this stupid error…

Thanks a lot =)

2007/9/16, Ryan C. Gordon :>

assert((SDL_Init(SDL_INIT_VIDEO) < 0), ("Unable to init SDL : " ~
SDL_GetDError()));

You are asserting that SDL_Init() failed, right? You’re basically saying:

if (SDL_Init() doesn’t report failure) { abort(“Unable to init…”); }

So that should be:

 assert((SDL_Init(SDL_INIT_VIDEO) == 0), "Unable to...")

SDL_Init() returning -1 means it failed.

Unable to init SDL : Failed loading DPMSDisable: /usr/lib/libX11.so.6:
undefined symbol: DPMSDisable

This is an error message that the X11 target generates when loading
non-essential symbols (even though ultimately everything works out).
Everything up to SDL 1.2.12 will report this if you ask for the last
error message after SDL_Init() when SDL_Init() didn’t actually fail. We
have fixed this in Subversion to clear the error message if all the
essential symbols are found to reduce unnecessary bug reports.

Fix your assertion, though, and your problem should go away.

–ryan.


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