Getting Cpw to install...

Hi. I’m trying to get started using Cpw. I’ve got a cygwin environment for compiling but I’ve also got mingw available on my Windows computer. I’ve downloaded version 1.0 of Cpw. Do I just copy the libraries in the cpw/library/output/win32 directories some place and the “cpw.h” file in another and begin including, compiling and linking or do I actually have to compile Cpw on my computer before using it. If so, is there a quick and easy way to compile, ie. by changing to some directory and invoking some compile command? Any help would be greatly appreciated. Thank you.

I put together a “makeshift” make file for cygwin but it’s not complete. It’s in the cygwin platform folder. I do not know make files very well so it will need an update to get it compiling right. If anybody does this please send me an update so I can put it in the core distro.

As far as compiling an app - take a look at the template in sample code folder. It has a description of what you need to compile with and link too the Cpw library. (Basically, the includes folder, the lib, and cpw.h.)

Regards,
Jim

Dear Jim:

I looked at your make file and updated it as follows:
------------------------------------CygWin Makefile--------------------------------------

You need to SET ‘CygWin’ as an env. var or this will spew puke.

VPATH = …/…/src/include:…/…/src/win32/:/d/freetype-2.0.6/include
INCLUDEFLAGS = -I…/…/src/include -I…/…/includes/win32 -I/usr/include/mingw -I/d/freetype-2.0.6/include

SRCS = …/…/src/cpw_callbacks.c
…/…/src/cpw_error.c
…/…/src/cpw_event.c
…/…/src/cpw_get.c
…/…/src/cpw_glextensions.c
…/…/src/cpw_init.c
…/…/src/cpw_joystick.c
…/…/src/cpw_keymouse.c
…/…/src/cpw_main.c
…/…/src/cpw_menus.c
…/…/src/cpw_perftracker.c
…/…/src/cpw_primitives.c
…/…/src/cpw_state.c
…/…/src/cpw_timers.c
…/…/src/cpw_videosettings.c
…/…/src/win32/cpw_win32.c
…/…/src/cpw_window.c
…/…/src/cpw_windowlist.c
…/…/src/cpw_opensl.c \

…/…/src/cpw_font.c \

HDRS = cpw_callbacks.h
cpw_config.h
cpw_error.h
cpw_event.h
cpw_get.h
cpw_glextensions.h
cpw_init.h
cpw_joystick.h
cpw_keymouse.h
cpw_linkedlist.h
cpw_linkedelement.h
cpw_macros.h
cpw_main.h
cpw_menus.h
cpw_perftracker.h
cpw_primdata.h
cpw_primitives.h
cpw_state.h
cpw_str.h
cpw_timers.h
cpw_videosettings.h
cpw_win32.h
cpw_window.h
cpw_windowlist.h
cpw_opensl.h \

cpw_font.h \

cpwlib : (SRCS) (HDRS)
gcc -mno-cygwin -DCPW_INTERN -DCygWin -UWIN32 (INCLUDEFLAGS) -c (SRCS)

cpwlib.a : (SRCS) (XTRAHDRS)
ar rvu cpwlib.a $(OBJS)
ranlib cpwlib.a

clean :
rm *.o

I can now make your library and make significant progress (many .o files
are made). However I do get the following error. Something to do with an ENUM_CURRENT_SETTINGS constant (the last error of the following output). Would anyone have any idea why I get this error? Thanks in advanced.

-Jose

-------------------------------Compiler error output------------------------------------
[jose@JOSEALBU /d/Cpw/library/projectfiles/cygwin] make gcc -mno-cygwin -DCPW_INTERN -DCygWin -UWIN32 -I../../src/include -I../../includes/win32 -I/usr/include/mingw -I/d/freetype-2.0.6/include -c ../../src/cpw_callbacks.c ../../src/cpw_error.c ../../src/cpw_event.c ../../src/cpw_get.c ../../src/cpw_glextensions.c ../../src/cpw_init.c ../../src/cpw_joystick.c ../../src/cpw_keymouse.c ../../src/cpw_main.c ../../src/cpw_menus.c ../../src/cpw_perftracker.c ../../src/cpw_primitives.c ../../src/cpw_state.c ../../src/cpw_timers.c ../../src/cpw_videosettings.c ../../src/win32/cpw_win32.c ../../src/cpw_window.c ../../src/cpw_windowlist.c ../../src/cpw_opensl.c ../../src/cpw_timers.c:125: warning: `cpw_timers_iteratestart' declared inline after being called ../../src/cpw_timers.c:134: warning: `cpw_timers_iteratenext' declared inline after being called ./../src/win32/cpw_win32.c: In function `cpw_localhost_listvideomodes': ../../src/win32/cpw_win32.c:1811: `ENUM_CURRENT_SETTINGS' undeclared (first use in this function) ../../src/win32/cpw_win32.c:1811: (Each undeclared identifier is reported only once ../../src/win32/cpw_win32.c:1811: for each function it appears in.) make: *** [cpwlib] Error 1 [jose@JOSEALBU /d/Cpw/library/projectfiles/cygwin]

Originally posted by jmathies:
[b]I put together a “makeshift” make file for cygwin but it’s not complete. It’s in the cygwin platform folder. I do not know make files very well so it will need an update to get it compiling right. If anybody does this please send me an update so I can put it in the core distro.

As far as compiling an app - take a look at the template in sample code folder. It has a description of what you need to compile with and link too the Cpw library. (Basically, the includes folder, the lib, and cpw.h.)

Regards,
Jim[/b]

Ok, a couple of comments:

  1. uncomment the

…/…/src/cpw_font.c \

and

cpw_font.h \

so the freetype interface compiles in. When I wrote that makefile I didn’t have freetype setup in my cygwin environment.

The two warnings about inlined functions can be ignored, i’ll take a look at this and clean it up in the next release.

ENUM_CURRENT_SETTINGS is a windows constant used in iterating video modes in the
EnumDisplaySettings call. I’m not sure what include you need in cygwin to get this. The
MSVC docs say it is defined in winuser.h and is part of the user32.lib. Looks like you
might need to upgrade your cygwin winuser.h - I found this on google:

http://www.mail-archive.com/cygwin-patches@cygwin.com/msg00219.html

Hope this helps you get it running! Thanks for makefile update. Let me know how it goes.

Regards,
Jim

[This message has been edited by jmathies (edited 02-22-2002).]

Dear Jim:

Thanks for your pointers. Your library actually compiles and I get a static library with cygwin. At first I kept getting multiple redefinition of certain functions errors when I tried to link to the library. I tried compiling the following simple program called “test.c”:

------------------------------------------------test.c----------------------------------------------------
#include <stdio.h>

#define CPW_EXTERN
#include <cpw.h>

void draw( pCpw cpw, int winid )
{
/* nothing yet! */
}

int main(int argc, char *argv[])
{
pCpw cpw;

cpw = null;
cpwInitContext( &cpw );

cpwCreateWindow( cpw, "Cpw" );
cpwDisplayCallback( cpw, draw );

cpwMainLoop( cpw );
cpwFreeContext( &cpw );
return 0;

}

and got the following linking errors:

-----------------------------------------------output----------------------------------------------------
[jose@JOSEALBU /d/Cpw]$ cc -DCygWin -UWIN32 test.c 2>&1 -lcpw | more
test.c: In function main': test.c:19: warning: passing arg 2 ofcpwDisplayCallback’ from incompatible pointer type
/usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x1598):cpw_state.c: multiple definition of le_createElement' /c/WINDOWS/TEMP/ccgpbttf.o(.text+0x1598):test.c: first defined here /usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x15d0):cpw_state.c: multiple definition ofle_initStr’
/c/WINDOWS/TEMP/ccgpbttf.o(.text+0x15d0):test.c: first defined here
/usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x1634):cpw_state.c: multiple definition of le_initString' /c/WINDOWS/TEMP/ccgpbttf.o(.text+0x1634):test.c: first defined here /usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x1698):cpw_state.c: multiple definition ofle_initFloat64’
/c/WINDOWS/TEMP/ccgpbttf.o(.text+0x1698):test.c: first defined here
/usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x16ec):cpw_state.c: multiple definition of le_initInt32' /c/WINDOWS/TEMP/ccgpbttf.o(.text+0x16ec):test.c: first defined here /usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x1748):cpw_state.c: multiple definition ofle_initVoid’
/c/WINDOWS/TEMP/ccgpbttf.o(.text+0x1748):test.c: first defined here
/usr/lib/mingw/libcpw.a(cpw_state.o)(.text+0x179c):cpw_state.c: multiple definition of `le_freeElement’
/c/WINDOWS/TEMP/ccgpbttf.o(.text+0x179c):test.c: first defined here
[jose@JOSEALBU/d/Cpw]$

I figured out that the multiple includes of the cpw_linkedelement.h and cpw_linkedlist.h files in other files were causing the problem. I neatly separated the implementation in these files from the definition to separate .c files and now the those multiple definitions disappeared. Now I only get the following errors:

----------------------------------undefined link symbols----------------------------------------------
[jose@JOSEALBU /d/Cpw]$ cc -DCygWin -UWIN32 *.c -lcpw -lfreetype -lopengl32 -lglu32 -lglaux 2>&1
test.c: In function main': test.c:19: warning: passing arg 2 ofcpwDisplayCallback’ from incompatible pointer type
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x1936):cpw_win32.c: undefined reference to SetClassLongPtr' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x194b):cpw_win32.c: undefined reference toSetWindowLongPtr’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x1a56):cpw_win32.c: undefined reference to SetClassLongPtr' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x1a6b):cpw_win32.c: undefined reference toSetWindowLongPtr’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x27d7):cpw_win32.c: undefined reference to ChoosePixelFormat@8' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x285b):cpw_win32.c: undefined reference toSetPixelFormat@12’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x2993):cpw_win32.c: undefined reference to SwapBuffers@4' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x2bc8):cpw_win32.c: undefined reference toGetClassLongPtr’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x2c0e):cpw_win32.c: undefined reference to GetWindowLongPtr' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x474b):cpw_win32.c: undefined reference tojoyGetNumDevs@0’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x47a3):cpw_win32.c: undefined reference to joyGetDevCapsA@12' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x47d6):cpw_win32.c: undefined reference tojoyGetDevCapsA@12’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x4995):cpw_win32.c: undefined reference to joyGetPosEx@8' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x49c6):cpw_win32.c: undefined reference tojoyGetPosEx@8’
collect2: ld returned 1 exit status
[jose@JOSEALBU /d/Cpw]$

I figure it is some sort of missing windows library, but I’m not sure. At any rate, I’m just happy that I can actually get a static library and sooner or later I’ll find why these undefined reference exist. In the mean time, I’ll just use dll linking! Also, I’ve made a nice update to the makefile included below in case you think you might use it. Thanks for your nice library! Take care.

-Jose
------------------------------------------------Makefile-------------------------------------------------
SRC = …/…/src
INCLUDE = $(SRC)/include
FREETYPE = /d/freetype-2.0.6

VPATH = $(SRC):$(INCLUDE):$(SRC)/win32:$(FREETYPE)/include

OBJS = cpw_callbacks.o
cpw_error.o
cpw_event.o
cpw_font.o
cpw_get.o
cpw_glextensions.o
cpw_images.o
cpw_init.o
cpw_joystick.o
cpw_keymouse.o
cpw_libtarga.o
cpw_linkedelement.o
cpw_linkedlist.o
cpw_main.o
cpw_menus.o
cpw_opensl.o
cpw_perftracker.o
cpw_primitives.o
cpw_state.o
cpw_timers.o
cpw_videosettings.o
cpw_win32.o
cpw_window.o
cpw_windowlist.o

CC = gcc
CFLAGS = -mno-cygwin -DCPW_INTERN -DCygWin -UWIN32 -I$(INCLUDE)
-I$(SRC)/win32 -I$(FREETYPE)/include

libcpw.a: $(OBJS)
ar rvu libcpw.a $(OBJS)
ranlib libcpw.a

cpw_callbacks.o: cpw_callbacks.h cpw_window.h
cpw_error.o: cpw_error.h
cpw_event.o: cpw_event.h cpw_error.h cpw_windowlist.h cpw_win32.h
cpw_font.o: cpw_font.h cpw_error.h cpw_win32.h
cpw_get.o: cpw_event.h cpw_error.h cpw_windowlist.h
cpw_glextensions.o: cpw_glextensions.h cpw_windowlist.h cpw_error.h
cpw_images.o: cpw_images.h cpw_error.h cpw_libtarga.h cpw_window.h
cpw_init.o: cpw_init.h cpw_error.h
cpw_joystick.o: cpw_joystick.h cpw_error.h cpw_timers.h cpw_win32.h
cpw_keymouse.o: cpw_keymouse.h cpw_error.h cpw_win32.h
cpw_libtarga.o: cpw_libtarga.h
cpw_linkedelement.o: cpw_linkedelement.h
cpw_linkedlist.o: cpw_linkedlist.h
cpw_main.o: cpw_main.h cpw_event.h cpw_error.h cpw_timers.h cpw_win32.h
cpw_menus.o: cpw_menus.h cpw_error.h cpw_windowlist.h cpw_win32.h
cpw_opensl.o: cpw_opensl.h
cpw_perftracker.o: cpw_perftracker.h cpw_error.h cpw_win32.h
cpw_primitives.o: cpw_primitives.h cpw_primdata.h cpw_error.h
cpw_state.o: cpw_state.h cpw_event.h cpw_init.h cpw_window.h cpw_windowlist.h
cpw_menus.h cpw_timers.h cpw_joystick.h cpw_videosettings.h
cpw_primitives.h cpw_glextensions.h cpw_perftracker.h cpw_font.h
cpw_win32.h
cpw_timers.o: cpw_timers.h cpw_error.h cpw_linkedlist.h cpw_joystick.h
cpw_win32.h
cpw_videosettings.o: cpw_videosettings.h cpw_window.h cpw_error.h cpw_win32.h
cpw_win32.o: cpw_win32.h cpw_event.h cpw_error.h cpw_init.h cpw_main.h
cpw_windowlist.h cpw_joystick.h
cpw_window.o: cpw_window.h cpw_windowlist.h cpw_event.h cpw_main.h
cpw_error.h cpw_win32.h
cpw_windowlist.o: cpw_windowlist.h

clean:
rm -f *.o libcpw.a

Dude, you rock. thanks for the makefile update.

A couple comments:

On the linked list issues - those functions are inlined, I wonder if this is what’s
causing the problem? Maybe if they were simply statically defined it wouldn’t be an issue?

In any case, I’ll seperate those out just like you did for the next release i’ll up
and include the new makefile in the release as well. By the way, did you have to make
any changes to the cpw_config.h for cygwin?

On those unresolved externals:

reference to SetClassLongPtr' reference to SetWindowLongPtr’
reference to SetClassLongPtr' reference to SetWindowLongPtr’
reference to GetClassLongPtr' reference to GetWindowLongPtr’

Standard windows calls for adding / extracting application specific data into a
window class or window context. Maybe an update of your winuser.h for cygwin would
fix it? Searching google i see patches listed for some of these.

reference to ChoosePixelFormat@8' reference to SetPixelFormat@12’
reference to `SwapBuffers@4’

OpenGL GDI calls. These should be in there someplace.

reference to joyGetNumDevs@0' reference to joyGetDevCapsA@12’
reference to joyGetDevCapsA@12' reference to joyGetPosEx@8’
reference to `joyGetPosEx@8’

Winbase joystick state polling.

Hope this helps… If you want to discuss feel free to mail me directly - my emails on
my site - http://www.mathies.com/

Regards,
Jim

[This message has been edited by jmathies (edited 02-25-2002).]

Something else you’ll need to do:

in cpw_config.h, there are some types defined for CygWin. The uint_8 isn’t defined right, and that will cause some problems.

Here’s an update:

#define pVoid     void*
#define pChar     char*
#define uint_8    unsigned char
#define uint_16   unsigned short
#define uint_32   unsigned int
#define int_16    int
#define int_32    int
#define int_64    int
#define float_32  float
#define float_64  double
#define long_32   long

Regards,
Jim

jaalburquerque,
Those undefined reference errors are not a header file problem, they’re a linking problem. The joystick functions are contained in libwinmm.a and ChoosePixelFormat is in libgdi32.a (I think). When compiling a CPW program with GCC you need to add -lwinmm and -lgdi32 and several other libraries after -lcpw (not before).

Jim,
The linked-list inline functions in the header files are a real problem for GCC. Apparently, declaring things inline in GCC does not garauntee that they will actually be inline (and sometimes they are both). To make the code more portable, I would suggest zapping all those inlines and just using regular functions. I don’t think it would have a noticable effect on performance.

P.S. I think CPW is great. Keep up the good work.

Hey Aaron, thanks for the reply.

With Jose’s help we found a solution. He seperated the linked list and element
into two files, which allowed us to keep the inlining that worked both with gcc and msdev.
(the functions now have a “extern CPW_INLINE” in front of them in the .h’s.)

The latest downloadable source on the cpw web site contains the
changes and Jose’s Cygwin makefile.

I was able to compile cleanly both with Cygwin and msdev. Very cool to see.
The Cygwin lib still needs to be tested, but it’s nice to see it compiling in that env.

Regards,
Jim

[This message has been edited by jmathies (edited 02-27-2002).]

Aaron:

You’re right about the undefined references being a linking problem. The two libraries you mentioned (namely winmm and gdi32) made some of the references like the joystick reference disappear. I did some searching and I found that the GetWindowLongPtr, GetClassLongPtr should somehow be part of the “winuser.h” file (and consequently the user32 library in /lib/mingw I guess). Here’s what’s in winuser.h right now:

------------------------------------------winuser.h----------------------------------------------
winuser.h :DWORD WINAPI GetClassLongA(HWND,int);
winuser.h :DWORD WINAPI GetClassLongW(HWND,int);
winuser.h :DWORD WINAPI SetClassLongA(HWND,int,LONG);
winuser.h :DWORD WINAPI SetClassLongW(HWND,int,LONG);
winuser.h:#define GetClassLong GetClassLongW
winuser.h:#define SetClassLong SetClassLongW
winuser.h:#define GetClassLong GetClassLongA
winuser.h:#define SetClassLong SetClassLongA
winuser.h:LONG WINAPI GetWindowLongA(HWND,int);
winuser.h:LONG WINAPI GetWindowLongW(HWND,int);
winuser.h:LONG WINAPI SetWindowLongA(HWND,int,LONG);
winuser.h:LONG WINAPI SetWindowLongW(HWND,int,LONG);
winuser.h:#define GetWindowLong GetWindowLongW
winuser.h:#define SetWindowLong SetWindowLongW
winuser.h:#define GetWindowLong GetWindowLongA
winuser.h:#define SetWindowLong SetWindowLongA

The funny thing is that my linking is also producing errors that reffer to _impure_ptr and __srget which I found to be referenced in <stdio.h>:

-------------------------------------------stdio.h--------------------------------------------------
stdio.h:#define stdin (_impure_ptr->_stdin)
stdio.h:#define stdout (_impure_ptr->_stdout)
stdio.h:#define stderr (_impure_ptr->_stderr)
stdio.h:int _EXFUN(__srget, (FILE *));

Perhaps the inlining is causing “stdin” or “stdout” to appear literrally as the actual definition in <stdio.h>. Here’s my linking output:

---------------------------------------------output--------------------------------------------------
[jose@JOSEALBU /d/Cpw]$ cc -DCygWin -UWIN32 *.c -lcpw -lfreetype -lopengl32 -lglu32 -lwinmm -lgdi32 2>&1 | more
test.c: In function main': test.c:19: warning: passing arg 2 ofcpwDisplayCallback’ from incompatible poin
ter type
/usr/lib/mingw/libcpw.a(cpw_init.o)(.text+0x15b0):cpw_init.c: undefined referenc
e to _impure_ptr' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x1986):cpw_win32.c: undefined refere nce toSetClassLongPtr’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x199b):cpw_win32.c: undefined refere
nce to SetWindowLongPtr' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x1aba):cpw_win32.c: undefined refere nce toSetClassLongPtr’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x1acf):cpw_win32.c: undefined refere
nce to SetWindowLongPtr' /usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x2e38):cpw_win32.c: undefined refere nce toGetClassLongPtr’
/usr/lib/mingw/libcpw.a(cpw_win32.o)(.text+0x2e7e):cpw_win32.c: undefined refere
nce to GetWindowLongPtr' /usr/lib/mingw/libcpw.a(cpw_perftracker.o)(.text+0x19a1):cpw_perftracker.c: unde fined reference to_impure_ptr’
/usr/lib/mingw/libcpw.a(cpw_perftracker.o)(.text+0x19b5):cpw_perftracker.c: unde
fined reference to _impure_ptr' /usr/lib/mingw/libcpw.a(cpw_perftracker.o)(.text+0x19be):cpw_perftracker.c: unde fined reference to__srget’
/usr/lib/mingw/libcpw.a(cpw_perftracker.o)(.text+0x19c9):cpw_perftracker.c: unde
fined reference to `_impure_ptr’
collect2: ld returned 1 exit status
[jose@JOSEALBU /d/Cpw]$

Over all, if we manage to address the {Get,Set}{Window,Class}LongPtr references (by maybe appropriately defining them in “winuser.h”) and somehow making those _impure_ptr and __srget undefined references to disappear, we will most probably have a static library up and ready for linking and testing for cygwin environment.

Thanks for the pointers!

-Jose

[This message has been edited by jaalburquerque (edited 02-27-2002).]

[This message has been edited by jaalburquerque (edited 02-27-2002).]

[This message has been edited by jaalburquerque (edited 02-27-2002).]

Guys, I hope this will be my last post to this topic !

I just thought I would say that my linking problems are solved. The reason why those undefined reference in <stdio.h> appear is that the Makefile includes a “-L/usr/include” option to gcc. The makefile also forces gcc to compile with the “mno-cygwin” option which makes the final compile cygwin independent (ie. it stands alone as a true windows product). Gcc does this by only including files from “/usr/include/w32api” and “/usr/include/mingw” and linking to the corresponding libraries in “/lib/w32api” and “/lib/mingw” respectively.

The problem is that the standard cygwin distribution does not include standard library definitions such as <stdio.h> and others in the “w32api” and “mingw” directories. To do that you have to install the “ming-runtime” library for cygwin (in the “Libs” category). My system had those installed, so when I compiled with the “mno-cygwin” option, only those symbols which are “really” undefined were reported upon linking.

A problem arise when the “w32api” and “mingw” includes/libraries are mixed with the standard “/usr/include” and “/lib” includes/libraries (using the “-L/usr/include” in the Makefile) and this is what was happening in my system: The <stdio.h> include file which is slightly different from the one in “/usr/include/mingw” was being linked against the libraries that it found in “/lib/mingw” producing the “undefined symbols” errors for some symbols. It was not the inlining at all. The inling is fine!

Anyway, maybe I ought to write some docs up explaining all this! At the end, the only missing symbols are the {Get,Set}{Class,Window}LongPtr. Thanks again Jim for your excellent library!

[This message has been edited by jaalburquerque (edited 02-28-2002).]

[This message has been edited by jaalburquerque (edited 02-28-2002).]

I forgot about the {Get, Set}{Window, Class}LongPtr issue; I had to change these to get them to compile. I simply removed the “Ptr” from the functions and changed the type cast for the pointer argument as in the following example:

SetWindowLongPtr( hwnd, 0, (LONG_PTR) id ); // original
SetWindowLong( hwnd, 0, (LONG) id ); // modified

I have a feeling that the LongPtr functions are just #defined macros that call the Long functions, but these seem to be missing from the cygwin/mingw header files.
I hope this solves the problem.

__
Aaron

It does indeed Aaron. I also found a link on the Web that provides patches to “winuser.h” to fix the {Set,Get}WindowLongPtr definitions( http://www.cygwin.com/ml/cygwin-cvs/2002-q1/msg00111.html ). Like you said, they are just #defines and what I’ll do probably is that I’ll also put the appropriate {Get,Set}ClassLongPtr definitions in “winuser.h”. Thanks again!

-Jose