[GEM-dev] compiling gem with mingw - almost there ...

Thoralf Schulze thoralf_schulze at yahoo.de
Wed Jul 13 17:12:15 CEST 2005


Hi there, especially Johannes,

the never-ending story continues ... but the end is
getting near.

After having a look at the ms psdk, I decided to
comment out the offending lines in pix_videoDS.h
(1271-72):

  wsprintfW(wsz, L"FilterGraph %08x pid %08x",
(DWORD_PTR)pUnkGraph, 
	    GetCurrentProcessId());

Am I right with the assumption that the above line
just prints out some debugging stuff?
According to the MS PSDK, wsprintfW is deprecated and
should not be used anymore. They recommend using
StringCchPrintfW instead, but that didn't work either
- in any case, they didn't manage a smooth transition
...Will it do any harm do gem if this statement is
missing in the dll?

Furthermore, I ran into some trouble with
partlib_actions.cpp : including iostream.h instead of
iostream doesn't work with mingw, iostream works quite
well on the other hand. Since iostream.h is necessary
for vc6, I changed this block to:

#if defined __WIN32__ && !defined __MINGW32__
/* jmz: at least my vc6 doesn't like linking against
the "new" io-libraries
 * with <iostream.h> it links against the old libs */
#include <iostream.h>
#else
#include <iostream>
#endif

which compiled fine. 
Another issue in this file is the use of the drand48()
function, which was missing. It gets defined in
part_vector.h, but the function was still missing
after I included this file in partlib_actions.cpp.
Looks like the WIN32 definition gets lost somewhere
inbetween?
I resorted to copy&paste the definition
#ifdef __WIN32__
#define drand48() (((float) rand())/((float)
RAND_MAX))
#define srand48(x) srand(x)
#endif
into partlib_actions.cpp, that worked.

I realise that these are quite ugly hacks, but I just
want to get the cvs gem compiled with mingw ... 

Another issue is linking all the .o-files into a dll -
command line for dllwrap.exe is getting too long ...
bummer.

with kind regards,
thoralf.


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com




More information about the GEM-dev mailing list