FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?> -----Original Message-----

From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a
lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about them.
Im not the kind of person to ignore compile warnings but this one shouldnt
give you any trouble.> ----- Original Message -----

From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?> ----- Original Message -----

From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

But it would help with this part of the question :slight_smile:

If I compile this like this:
gcc -o test1.exe test1.c
I get this output when I run it:
Hello World
With out changing the code at all, if I compile it like this:
gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c
The program will crash when I try to run it.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Jueves, 10 de Julio de 2003 03:26 p.m.
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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

I think your seg fault is unrelated to those warnings.

Heres an analogy (not exact but close so bear with me lol)…

lets pretend i build machines for you but you have to tell me what the
machines do and how they work.

So you give me a design and tell me where the parts are, you point to a box
and say “use parts from that box” and i say “warning, you already told me to
use that box” but i build your machine anyways.

Just because you already told me to use the box, does that mean the machine
i give you will work any differently?

your seg fault is most likely due to your code, what i generaly do to debug
is either put in printf’s to see where the code crashed by seeing the last
thing that got printed…or i do the same thing but write it out to a log
file. I dont use gdb and im still pretty successful at debugging (:

hope this helps!
Atrix> ----- Original Message -----

From: wesley.lemke@libertymutual.com (Lemke, Wesley)
To:
Sent: Thursday, July 10, 2003 11:42 AM
Subject: RE: [SDL] FW: Error when linking to SDL

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?

-----Original Message-----
From: Atrix Wolfe [mailto:@atrix2]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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

I also debug the way you do, using print messages. Look at this
program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}

Even this program will segfault before it prints anything. I’m assuming
that because I link to SDL the executable loads those libraries, so
there must be something wrong with my SDL.dll? I’m not familiar enough
with how it all works to be sure though…> ----- Original Message -----

From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:54 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

I think your seg fault is unrelated to those warnings.

Heres an analogy (not exact but close so bear with me lol)…

lets pretend i build machines for you but you have to tell me what the
machines do and how they work.

So you give me a design and tell me where the parts are, you point to a
box and say “use parts from that box” and i say “warning, you already
told me to use that box” but i build your machine anyways.

Just because you already told me to use the box, does that mean the
machine i give you will work any differently?

your seg fault is most likely due to your code, what i generaly do to
debug is either put in printf’s to see where the code crashed by seeing
the last thing that got printed…or i do the same thing but write it
out to a log file. I dont use gdb and im still pretty successful at
debugging (:

hope this helps!
Atrix

----- Original Message -----
From: @Lemke_Wesley (Lemke, Wesley)
To:
Sent: Thursday, July 10, 2003 11:42 AM
Subject: RE: [SDL] FW: Error when linking to SDL

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?

-----Original Message-----
From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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


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

ah yeah, didnt see that> ----- Original Message -----

From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:40 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

But it would help with this part of the question :slight_smile:

If I compile this like this:
gcc -o test1.exe test1.c
I get this output when I run it:
Hello World
With out changing the code at all, if I compile it like this:
gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c
The program will crash when I try to run it.

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Atrix Wolfe [mailto:@atrix2]
Sent: Jueves, 10 de Julio de 2003 03:26 p.m.
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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

Run it, see where does it segfault. Probably before main().

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 03:43 p.m.
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?

-----Original Message-----
From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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

I have the graphical version of gdb that comes with cygwin. I clicked
run and then viewed the stack. This is what it says:

_mingw_CRTStartup
Main

(main was highlighted in yellow).

Like I said I’m not good with gdb (especially this graphical
version…) let me know if there is anything else that will help.> ----- Original Message -----

From: Gabriel Gambetta [mailto:ggambett@artech.com.uy]
Sent: Thursday, July 10, 2003 2:06 PM
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

Run it, see where does it segfault. Probably before main().

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 03:43 p.m.
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?

-----Original Message-----
From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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


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

I just figured out how to run the debugger in text mode. Here is the
output:

[18 NA900002 at LIBERTY-JDSFZXH (14:29:22) sdlTest] gdb -nw test1.exe
GNU gdb 5.0 (20010428-3)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i686-pc-cygwin”…
(gdb) run
Starting program: /home/NA900002/code/c/sdlTest/test1.exe

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) where
#0 0x00000000 in ?? ()
(gdb)

It doesn’t mean much to me, but doesn’t look pretty.> ----- Original Message -----

From: Gabriel Gambetta [mailto:ggambett@artech.com.uy]
Sent: Thursday, July 10, 2003 2:06 PM
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

Run it, see where does it segfault. Probably before main().

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 03:43 p.m.
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?

-----Original Message-----
From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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


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

Try putting #include “SDL.h” at the top. I think the problem is because
you’re linking with SDLmain.lib which assumes that main() has been
redefined, but you’re not including SDL_main.h which actually redefines
the function.

Hope this helps,

Tony

Lemke, Wesley wrote:> I also debug the way you do, using print messages. Look at this

program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}

Even this program will segfault before it prints anything. I’m assuming
that because I link to SDL the executable loads those libraries, so
there must be something wrong with my SDL.dll? I’m not familiar enough
with how it all works to be sure though…

The stack is already screwed so there’s no information about what or
where it’s segfaulting :frowning:

Let’s hear the gurus now…

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 04:30 p.m.
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

I just figured out how to run the debugger in text mode. Here is the
output:

[18 NA900002 at LIBERTY-JDSFZXH (14:29:22) sdlTest] gdb -nw test1.exe GNU
gdb 5.0 (20010428-3) Copyright 2001 Free Software Foundation, Inc. GDB
is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions. Type “show copying” to see the conditions. There is
absolutely no warranty for GDB. Type “show warranty” for details. This
GDB was configured as “i686-pc-cygwin”…
(gdb) run
Starting program: /home/NA900002/code/c/sdlTest/test1.exe

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) where
#0 0x00000000 in ?? ()
(gdb)

It doesn’t mean much to me, but doesn’t look pretty.

-----Original Message-----
From: Gabriel Gambetta [mailto:ggambett@artech.com.uy]
Sent: Thursday, July 10, 2003 2:06 PM
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

Run it, see where does it segfault. Probably before main().

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 03:43 p.m.
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

I am ignoring the warnings at compile time, I just put them in the
message in case they helped find the problem. The program, when linked
to SDL, seg faults. I am trying to use gdb now (I’m not real good with
it however). Anything in particular I should find out from gdb?

-----Original Message-----
From: Atrix Wolfe [mailto:atrix2@cox.net]
Sent: Thursday, July 10, 2003 1:26 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

gdb wouldnt help, hes saying hes getting compile time warnings :stuck_out_tongue:

Lemke, these warnings look 100% harmless, i myself wouldnt worry about
them. Im not the kind of person to ignore compile warnings but this one
shouldnt give you any trouble.

----- Original Message -----
From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Thursday, July 10, 2003 11:05 AM
Subject: RE: [SDL] FW: Error when linking to SDL

gdb?

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

-----Original Message-----
From: Lemke, Wesley [mailto:Wesley.Lemke@LibertyMutual.com]
Sent: Jueves, 10 de Julio de 2003 02:52 p.m.
To: sdl at libsdl.org
Subject: [SDL] FW: Error when linking to SDL

No one has any ideas on where to start looking for the problem?

-----Original Message-----
From: Lemke, Wesley
Sent: Wednesday, July 09, 2003 10:30 AM
To: 'sdl at libsdl.org
Subject: Error when linking to SDL

I compiled SDL with cygwin. When compiling I saw this warning quite a

lot, but it went smooth besides it:

cc1: warning: changing search order for system directory
"/usr/include/mingw"
cc1: warning: as it has already been specified as a non-system
directory

I created a simple program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);

    exit(0);

}

If I compile this like this:

gcc -o test1.exe test1.c

I get this output when I run it:

Hello World

With out changing the code at all, if I compile it like this:

gcc -o test1.exe sdl-config --cflags sdl-config --libs test1.c

The program will crash when I try to run it.

Any ideas on what the problem could be?


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


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


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


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


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


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

I just tried that:

[24 NA900002 at LIBERTY-JDSFZXH (14:52:40) sdlTest] cat test1.c
#include <stdio.h>
#include “SDL.h”

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}
[25 NA900002 at LIBERTY-JDSFZXH (14:52:44) sdlTest] make
make test1
make[1]: Entering directory /home/NA900002/code/c/sdlTest' gcc -o test1.exesdl-config --cflagssdl-config --libstest1.c cc1: warning: changing search order for system directory "/usr/include/mingw" cc1: warning: as it has already been specified as a non-system directory make[1]: Leaving directory/home/NA900002/code/c/sdlTest’
[26 NA900002 at LIBERTY-JDSFZXH (14:52:47) sdlTest] gdb -nw test1.exe
GNU gdb 5.0 (20010428-3)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i686-pc-cygwin”…
(gdb) run
Starting program: /home/NA900002/code/c/sdlTest/test1.exe

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) where
#0 0x00000000 in ?? ()
(gdb)

Still no luck. Any other ideas?> ----- Original Message -----

From: Anthony Lewis [mailto:tony@tonyandpaige.com]
Sent: Thursday, July 10, 2003 2:49 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

Try putting #include “SDL.h” at the top. I think the problem is because

you’re linking with SDLmain.lib which assumes that main() has been
redefined, but you’re not including SDL_main.h which actually redefines
the function.

Hope this helps,

Tony

Lemke, Wesley wrote:

I also debug the way you do, using print messages. Look at this
program:

#include <stdio.h>

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}

Even this program will segfault before it prints anything. I’m
assuming that because I link to SDL the executable loads those
libraries, so there must be something wrong with my SDL.dll? I’m not
familiar enough with how it all works to be sure though…


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

I’m only guessing here, but could it be the problem with compiler flags?
Try

gcc test1.c -o test1.exe sdl-config --cflags --libs

As I said, only a guess, but you never know…On Thu, Jul 10, 2003 at 03:58:58PM -0400, Lemke, Wesley wrote:

I just tried that:

[24 NA900002 at LIBERTY-JDSFZXH (14:52:40) sdlTest] cat test1.c
#include <stdio.h>
#include “SDL.h”

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}
[25 NA900002 at LIBERTY-JDSFZXH (14:52:44) sdlTest] make
make test1
make[1]: Entering directory /home/NA900002/code/c/sdlTest' gcc -o test1.exesdl-config --cflagssdl-config --libs` test1.c
cc1: warning: changing search order for system directory


Ivan Stankovic, @Ivan_Stankovic

Nope, still didn’t work. Calling all gurus! :)> ----- Original Message -----

From: Ivan Stankovic [mailto:pokemon@fly.srk.fer.hr]
Sent: Thursday, July 10, 2003 4:41 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

On Thu, Jul 10, 2003 at 03:58:58PM -0400, Lemke, Wesley wrote:

I just tried that:

[24 NA900002 at LIBERTY-JDSFZXH (14:52:40) sdlTest] cat test1.c #include
<stdio.h> #include “SDL.h”

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}
[25 NA900002 at LIBERTY-JDSFZXH (14:52:44) sdlTest] make
make test1
make[1]: Entering directory /home/NA900002/code/c/sdlTest' gcc -o test1.exesdl-config --cflagssdl-config --libs` test1.c
cc1: warning: changing search order for system directory

I’m only guessing here, but could it be the problem with compiler flags?
Try

gcc test1.c -o test1.exe sdl-config --cflags --libs

As I said, only a guess, but you never know…


Ivan Stankovic, pokemon at fly.srk.fer.hr


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

Here’s another stab in the dark – I had similar problems before, though
I never ran gdb on them so I’m not sure if it’s exactly the same.
Anyways, the warning you get I believe is caused by ‘sdl-config
–cflags’ returning an include directory that is already included in gcc
by default. Eg. if you type ‘sdl-config --cflags’ it should print
something like “-I/usr/include -I/usr/include/SDL -D_REENTRANT”. The
/usr/include may already be included by gcc, so try commenting it out in
sdl-config and see if the warning goes away :). (It may also be a
similar thing with sdl-config --libs and a -L flag, so try that too if
you can’t get it to go away).

That would get rid of the compiler warning, at least, but I doubt it
would fix the run-time crash (unless something wacky is going on with
your include files). The crash could be caused by library versioning
issues – have you installed SDL multiple times (perhaps by accident)?
For example, on my system (Redhat) SDL came installed in /usr. I didn’t
know that at the time, so I installed SDL from source with “make; make
install”, and that put the files in /usr/local. I’m not sure exactly
what was going on, I think gcc was compiling with one set of include
files and another set of libraries. Regardless, some SDL programs would
crash, others would work fine. Once I realized this and thoroughly
uninstalled one of the SDL’s and recompiled my programs, everything ran
fine. You can check by typing:

ls /usr/lib/libSDL*
ls /usr/local/lib/libSDL*

Only one of them should list any files. Or if you have locate, do
"locate libSDL*", and all your libSDL files listed should be in the same
directory. If the libraries are in more than one place you could have
the same problem I did. Then it’s just a matter of uninstalling
everything extra and recompiling. Eg. doing a “make uninstall” if you
built from source, or “rpm -e”, or whatever it is you normally do to
remove stuff.

Like I said, it’s a stab in the dark…so good luck :).

-MikeOn Thu, 2003-07-10 at 21:53, Lemke, Wesley wrote:

Nope, still didn’t work. Calling all gurus! :slight_smile:

-----Original Message-----
From: Ivan Stankovic [mailto:pokemon at fly.srk.fer.hr]
Sent: Thursday, July 10, 2003 4:41 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

On Thu, Jul 10, 2003 at 03:58:58PM -0400, Lemke, Wesley wrote:

I just tried that:

[24 NA900002 at LIBERTY-JDSFZXH (14:52:40) sdlTest] cat test1.c #include
<stdio.h> #include “SDL.h”

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}
[25 NA900002 at LIBERTY-JDSFZXH (14:52:44) sdlTest] make
make test1
make[1]: Entering directory /home/NA900002/code/c/sdlTest' gcc -o test1.exesdl-config --cflagssdl-config --libs` test1.c
cc1: warning: changing search order for system directory

I’m only guessing here, but could it be the problem with compiler flags?
Try

gcc test1.c -o test1.exe sdl-config --cflags --libs

As I said, only a guess, but you never know…


Ivan Stankovic, pokemon at fly.srk.fer.hr


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


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

I removed -I/usr/include/mingw from the --cflags of sdl-config. This
did clear up the warning, but the test1.exe still crashes.

I did a search through the system (find /cygdrive/c | grep -i sdl | grep
-i lib), and the only sdl files showed up under /cygwin/usr/local/ and
/SDL-1.2.5/. The /SDL-1.2.5 is where I compiled SDL. So it looks like
everything is installed correctly to me…

Please keep stabbing in the dark, someone will hit eventually :)> ----- Original Message -----

From: Mike Shal [mailto:marf@psu.edu]
Sent: Thursday, July 10, 2003 11:51 PM
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

Here’s another stab in the dark – I had similar problems before, though
I never ran gdb on them so I’m not sure if it’s exactly the same.
Anyways, the warning you get I believe is caused by ‘sdl-config
–cflags’ returning an include directory that is already included in gcc
by default. Eg. if you type ‘sdl-config --cflags’ it should print
something like “-I/usr/include -I/usr/include/SDL -D_REENTRANT”. The
/usr/include may already be included by gcc, so try commenting it out in
sdl-config and see if the warning goes away :). (It may also be a
similar thing with sdl-config --libs and a -L flag, so try that too if
you can’t get it to go away).

That would get rid of the compiler warning, at least, but I doubt it
would fix the run-time crash (unless something wacky is going on with
your include files). The crash could be caused by library versioning
issues – have you installed SDL multiple times (perhaps by accident)?
For example, on my system (Redhat) SDL came installed in /usr. I didn’t
know that at the time, so I installed SDL from source with “make; make
install”, and that put the files in /usr/local. I’m not sure exactly
what was going on, I think gcc was compiling with one set of include
files and another set of libraries. Regardless, some SDL programs would
crash, others would work fine. Once I realized this and thoroughly
uninstalled one of the SDL’s and recompiled my programs, everything ran
fine. You can check by typing:

ls /usr/lib/libSDL*
ls /usr/local/lib/libSDL*

Only one of them should list any files. Or if you have locate, do
"locate libSDL*", and all your libSDL files listed should be in the same
directory. If the libraries are in more than one place you could have
the same problem I did. Then it’s just a matter of uninstalling
everything extra and recompiling. Eg. doing a “make uninstall” if you
built from source, or “rpm -e”, or whatever it is you normally do to
remove stuff.

Like I said, it’s a stab in the dark…so good luck :).

-Mike

On Thu, 2003-07-10 at 21:53, Lemke, Wesley wrote:

Nope, still didn’t work. Calling all gurus! :slight_smile:

-----Original Message-----
From: Ivan Stankovic [mailto:pokemon at fly.srk.fer.hr]
Sent: Thursday, July 10, 2003 4:41 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

On Thu, Jul 10, 2003 at 03:58:58PM -0400, Lemke, Wesley wrote:

I just tried that:

[24 NA900002 at LIBERTY-JDSFZXH (14:52:40) sdlTest] cat test1.c
#include
<stdio.h> #include “SDL.h”

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}
[25 NA900002 at LIBERTY-JDSFZXH (14:52:44) sdlTest] make
make test1
make[1]: Entering directory /home/NA900002/code/c/sdlTest' gcc -o test1.exesdl-config --cflagssdl-config --libs` test1.c
cc1: warning: changing search order for system directory

I’m only guessing here, but could it be the problem with compiler
flags? Try

gcc test1.c -o test1.exe sdl-config --cflags --libs

As I said, only a guess, but you never know…


Ivan Stankovic, pokemon at fly.srk.fer.hr


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


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


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

I figured I’d try recompiling SDL w/o the /usr/local/mingw warning.
When I did this I noticed another warning, that seems to be more
important:

SDL_main.c: In function console_main': SDL_main.c:188: warning: implicit declaration of functionalloca’

I do have the file /usr/include/alloca.h, so I added the line:

#include <alloca.h>

The compiler complained that it couldn’t find alloca.h, so I changed the
line to:

#include “/usr/include/alloca.h”

Then I got the following errors:

In file included from /usr/include/alloca.h:10,
from SDL_main.c:17:
/usr/include/_ansi.h:15:20: newlib.h: No such file or directory
/usr/include/_ansi.h:16:24: sys/config.h: No such file or directory
In file included from SDL_main.c:17:
/usr/include/alloca.h:11:23: sys/reent.h: No such file or directory
make[2]: *** [SDL_main.o] Error 1

Shouldn’t /usr/include be a system include file? Should I just change
my cflags to have -I/usr/include?> ----- Original Message -----

From: Lemke, Wesley
Sent: Friday, July 11, 2003 10:06 AM
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

I removed -I/usr/include/mingw from the --cflags of sdl-config. This
did clear up the warning, but the test1.exe still crashes.

I did a search through the system (find /cygdrive/c | grep -i sdl | grep
-i lib), and the only sdl files showed up under /cygwin/usr/local/ and
/SDL-1.2.5/. The /SDL-1.2.5 is where I compiled SDL. So it looks like
everything is installed correctly to me…

Please keep stabbing in the dark, someone will hit eventually :slight_smile:

-----Original Message-----
From: Mike Shal [mailto:marf@psu.edu]
Sent: Thursday, July 10, 2003 11:51 PM
To: sdl at libsdl.org
Subject: RE: [SDL] FW: Error when linking to SDL

Here’s another stab in the dark – I had similar problems before, though
I never ran gdb on them so I’m not sure if it’s exactly the same.
Anyways, the warning you get I believe is caused by ‘sdl-config
–cflags’ returning an include directory that is already included in gcc
by default. Eg. if you type ‘sdl-config --cflags’ it should print
something like “-I/usr/include -I/usr/include/SDL -D_REENTRANT”. The
/usr/include may already be included by gcc, so try commenting it out in
sdl-config and see if the warning goes away :). (It may also be a
similar thing with sdl-config --libs and a -L flag, so try that too if
you can’t get it to go away).

That would get rid of the compiler warning, at least, but I doubt it
would fix the run-time crash (unless something wacky is going on with
your include files). The crash could be caused by library versioning
issues – have you installed SDL multiple times (perhaps by accident)?
For example, on my system (Redhat) SDL came installed in /usr. I didn’t
know that at the time, so I installed SDL from source with “make; make
install”, and that put the files in /usr/local. I’m not sure exactly
what was going on, I think gcc was compiling with one set of include
files and another set of libraries. Regardless, some SDL programs would
crash, others would work fine. Once I realized this and thoroughly
uninstalled one of the SDL’s and recompiled my programs, everything ran
fine. You can check by typing:

ls /usr/lib/libSDL*
ls /usr/local/lib/libSDL*

Only one of them should list any files. Or if you have locate, do
"locate libSDL*", and all your libSDL files listed should be in the same
directory. If the libraries are in more than one place you could have
the same problem I did. Then it’s just a matter of uninstalling
everything extra and recompiling. Eg. doing a “make uninstall” if you
built from source, or “rpm -e”, or whatever it is you normally do to
remove stuff.

Like I said, it’s a stab in the dark…so good luck :).

-Mike

On Thu, 2003-07-10 at 21:53, Lemke, Wesley wrote:

Nope, still didn’t work. Calling all gurus! :slight_smile:

-----Original Message-----
From: Ivan Stankovic [mailto:pokemon at fly.srk.fer.hr]
Sent: Thursday, July 10, 2003 4:41 PM
To: sdl at libsdl.org
Subject: Re: [SDL] FW: Error when linking to SDL

On Thu, Jul 10, 2003 at 03:58:58PM -0400, Lemke, Wesley wrote:

I just tried that:

[24 NA900002 at LIBERTY-JDSFZXH (14:52:40) sdlTest] cat test1.c
#include
<stdio.h> #include “SDL.h”

int main(int argc, char* argv[]){
printf(“Hello World\n”);
fflush(NULL);

    exit(0);

}
[25 NA900002 at LIBERTY-JDSFZXH (14:52:44) sdlTest] make
make test1
make[1]: Entering directory /home/NA900002/code/c/sdlTest' gcc -o test1.exesdl-config --cflagssdl-config --libs` test1.c
cc1: warning: changing search order for system directory

I’m only guessing here, but could it be the problem with compiler
flags? Try

gcc test1.c -o test1.exe sdl-config --cflags --libs

As I said, only a guess, but you never know…


Ivan Stankovic, pokemon at fly.srk.fer.hr


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


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


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


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