Cygwin layer and OpenGL

Hi,
I am currently trying to compile some program under windows using cygwin. It
uses posix functions and uses posix behaviour of functions. So it is not
possible to compile it without cygwin layer. It also uses SDLs opengl
initialisations and OpenGL to draw content.
The problem is that I am not able to compile the program with -lopengl32
(reports undefined symbols _glEnd). It compiles fine when specifying -lGL, but
then it is not possible to render something because libGL is used for all
calls by the program, but SDL used libopeng32 to initialise the program. Does
anybody know how to get both worlds (cygwin and SDL) together in a sane way?

Greetings,
Resul Cetin

My last mail was rejected. So here again:

Hi,
I am currently trying to compile some program under windows using cygwin. It
uses posix functions and uses posix behaviour of functions. So it is not
possible to compile it without cygwin layer. It also uses SDLs opengl
initialisations and OpenGL to draw content.
The problem is that I am not able to compile the program with -lopengl32
(reports undefined symbols _glEnd). It compiles fine when specifying -lGL, but
then it is not possible to render something because libGL is used for all
calls by the program, but SDL used libopeng32 to initialise the program. Does
anybody know how to get both worlds (cygwin and SDL) together in a sane way?

Greetings,
Resul Cetin

Why don’t you just use MinGW instead of cygwin? Works like a charm for
my cross platform project…

Best,
Oliver

Resul Cetin wrote:> My last mail was rejected. So here again:

Hi,
I am currently trying to compile some program under windows using cygwin. It
uses posix functions and uses posix behaviour of functions. So it is not
possible to compile it without cygwin layer. It also uses SDLs opengl
initialisations and OpenGL to draw content.
The problem is that I am not able to compile the program with -lopengl32
(reports undefined symbols _glEnd). It compiles fine when specifying -lGL, but
then it is not possible to render something because libGL is used for all
calls by the program, but SDL used libopeng32 to initialise the program. Does
anybody know how to get both worlds (cygwin and SDL) together in a sane way?

Greetings,
Resul Cetin


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

As I said before… It is a project using posix stuff and needs that posix
stuff to work. AFAIK MinGW doesnt provide that posix compatibility layer and
will not work.

ResulOn Thursday 27 November 2008 11:38:06 you wrote:

Why don’t you just use MinGW instead of cygwin? Works like a charm for
my cross platform project…

Oh, ok…

Resul Cetin wrote:> On Thursday 27 November 2008 11:38:06 you wrote:

Why don’t you just use MinGW instead of cygwin? Works like a charm for
my cross platform project…
As I said before… It is a project using posix stuff and needs that posix
stuff to work. AFAIK MinGW doesnt provide that posix compatibility layer and
will not work.

Resul

Hi Resul,

I think you are out ouf luck here, I also couldn’t manage to get a "pure"
Cygwin build in the past. All of the programs compiled with SDL and Cygwin
are using “-mno-cygwin”, so you loose the posix layer. Maybe you could tweak
SDL compilation system a bit in order to get it working…

El Jueves 27 Noviembre 2008ES 10:46:30 Resul Cetin escribi?:> My last mail was rejected. So here again:

Hi,
I am currently trying to compile some program under windows using cygwin.
It uses posix functions and uses posix behaviour of functions. So it is not
possible to compile it without cygwin layer. It also uses SDLs opengl
initialisations and OpenGL to draw content.
The problem is that I am not able to compile the program with -lopengl32
(reports undefined symbols _glEnd). It compiles fine when specifying -lGL,
but then it is not possible to render something because libGL is used for
all calls by the program, but SDL used libopeng32 to initialise the
program. Does anybody know how to get both worlds (cygwin and SDL) together
in a sane way?

Greetings,
Resul Cetin

Resul Cetin wrote:

Hi,
I am currently trying to compile some program under windows using cygwin. It
uses posix functions and uses posix behaviour of functions. So it is not
possible to compile it without cygwin layer. It also uses SDLs opengl
initialisations and OpenGL to draw content.
The problem is that I am not able to compile the program with -lopengl32
(reports undefined symbols _glEnd). It compiles fine when specifying -lGL, but
then it is not possible to render something because libGL is used for all
calls by the program, but SDL used libopeng32 to initialise the program. Does
anybody know how to get both worlds (cygwin and SDL) together in a sane way?

Greetings,
Resul Cetin

Hi Resul, I don’t have the tools setup now but I’ve used a combination
of SDL and an OpenGL in the past without passing -mno-cygwin to the
compiler. Here’s an example of one of my Makefiles that I used. It was
last modified on the 21st of july 2007 so it worked at least back then
but, unfortunately, I can’t test it now.

CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++98 -pedantic -g -I
~/SDL-1.2.12/include/SDL -c
LDFLAGS = -L ~/SDL-1.2.12/lib -lSDL -lopengl32 -lglu32 -lglut32 -o $(EXEC)
EXEC = runme.exe
OBJECTS = display.o main.o

all: $(OBJECTS)
$(CXX) $^ $(LDFLAGS)

display.o: display.cpp display.hpp
$(CXX) $(CXXFLAGS) $<

main.o: main.cpp display.hpp
$(CXX) $(CXXFLAGS) $<

clean:
rm -f $(OBJECTS) $(EXEC) $(EXEC).stackdump

As you can see I used SDL 1.1.12, and cygwin would’ve been current for
that time.
As I recall, I’m linking to glut just to be able to use
glutBitmapCharacter, nothing more. Right now there seems to be a problem
in cygwin with the win32api package shipping one version of glut and the
opengl package shipping a conflicting one, but it should be resolved
soon and it may not even affect you at all. I don’t know the details to
be able to say for sure, but I wanted to mention it anyway. Good luck!

  • EL

Hello EricOn 04.12.08, you wrote:

Hi Resul, I don’t have the tools setup now but I’ve used a combination
of SDL and an OpenGL in the past without passing -mno-cygwin to the
compiler. Here’s an example of one of my Makefiles that I used.

is there somewhere a binary package of SDL for cygwin to install ?
I did not find any.

I compile SDL for cygwin my own, type ./configure, make and make install
i install it and can compile defendguin

But OWB ( a web browser that use SDL for render
http://www.sand-labs.org/owb)
setup does always say i have no SDL installed.
In usr/local/bin/sdl-config is this after make install.strange that it use
mingw include.host and build is in configure correct show as i686-cygwin
and i compile under gcc in cygwin.

#!/bin/sh

prefix=/usr/local
exec_prefix=${prefix}
exec_prefix_set=no
libdir=${exec_prefix}/lib

#usage="
#Usage: sdl-config [–prefix[=DIR]] [–exec-prefix[=DIR]] [–version]
[–cflags] [–libs]"
usage=“
Usage: sdl-config [–prefix[=DIR]] [–exec-prefix[=DIR]] [–version]
[–cflags] [–libs] [–static-libs]”

if test $# -eq 0; then
echo “${usage}” 1>&2
exit 1
fi

while test $# -gt 0; do
case “$1” in
-=) optarg=echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//' ;;
*) optarg= ;;
esac

case $1 in
–prefix=)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
–prefix)
echo $prefix
;;
–exec-prefix=
)
exec_prefix=$optarg
exec_prefix_set=yes
;;
–exec-prefix)
echo $exec_prefix
;;
–version)
echo 1.2.13
;;
–cflags)
echo -I${prefix}/include/SDL -I/usr/include/mingw -mno-cygwin
-Dmain=SDL_main
;;
–libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDLmain -lSDL -mno-cygwin
-mwindows
;;
–static-libs)

–libs|–static-libs)

  echo -L${exec_prefix}/lib  -lmingw32 -lSDLmain -lSDL -mno-cygwin

-mwindows
;;
*)
echo “${usage}” 1>&2
exit 1
;;
esac
shift
done

Regards

Bernd Roesch wrote:

Hello Eric

Hi Resul, I don’t have the tools setup now but I’ve used a combination
of SDL and an OpenGL in the past without passing -mno-cygwin to the
compiler. Here’s an example of one of my Makefiles that I used.

is there somewhere a binary package of SDL for cygwin to install ?
I did not find any.

I just used the pre-compiled development libraries for MinGW available
on libsdl.org.
Also, I just updated my cygwin installation and installled the latest
OpenGL-package (that was, in fact, just updated) and “installed” the
latest SDL MinGW development libs by unpacking it into my home
directory. Then I tried building and running a test program and it
worked just fine.
I ran the program with:
$ PATH=$PATH:~/SDL-1.2.13/bin/ ./runme &
so I didn’t need to put SDL in the PATH for this test or have more than
one copy of the DLL-file.
The makefile of the program I tried was almost identical to the one I
posted previously, it had just been updated to look for SDL-1.1.13 instead.

I compile SDL for cygwin my own, type ./configure, make and make install
i install it and can compile defendguin

Sorry, no experience with this whatsoever.

[snip]

  • EL> On 04.12.08, you wrote: