Re: [wx-dev] fontenum.cpp wxFontEnumeratorProc declaration build error

5 views
Skip to first unread message

Dave Trollope

unread,
Nov 20, 2002, 10:28:21 PM11/20/02
to wx-...@lists.wxwindows.org
Hi Greg,

I too was using the canned files, not ./configure etc.

My build command was :
gcc --pipe -fvtable-thunks -c -D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400
-D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -I../../include
-I../../contrib/include -I../../src/png -I../../src/jpeg
-I../../src/zlib -I../../src/xpm -I../../src/tiff
-I../../include/wx/msw/gnuwin32 -DSTRICT -D__WXMSW__ -D__WINDOWS__
-D__WXDEBUG__ -Wall -fno-pcc-struct-return -O2 -fno-rtti
-fno-exceptions -o ../../src/msw/fontenum.o ../../src/msw/fontenum.cpp

so thats pretty similar.

I did in a separate dir download the CVS version and copy the file from
that that has #if defined (not #elif as you describe).... but those
changes didn't seem to make much difference although I realise there
could be other changes in the macro defs that I didn't copy.

I'll try to get the CVS version compiled and see if I have the same
problem - may not be tonight though.

Will get back to you about that tomorrow (or day after) - thanks for the
speedy response.
Dave
Greg Chicares wrote:

>Dave Trollope wrote:
>
>
>>I just downloaded and tried to compile wxWindows for the first time - I
>>like the look of it very much. I got it compiled, but ran into the
>>following problem which I wanted to ask about first before I submit a patch.
>>
>>Configuration: Windows 98 SE, Cygwin 1.13.5-2, gcc 3.2 20020927 -
>>building wxWindows 1.2.15.3
>>
>>msw/fontenum.cpp produced the following build error:
>>../../src/msw/fontenum.cpp: In member function `void
>> wxFontEnumeratorHelper::DoEnumerate()':
>>../../src/msw/fontenum.cpp:160: invalid conversion from `int (*)(const
>> LOGFONTA*, const TEXTMETRICA*, long unsigned int, long int)' to `int
>> (*)(const LOGFONTA*, const TEXTMETRICA*, long unsigned int, long int)'
>>make: *** [../../src/msw/fontenum.o] Error 1
>>
>>
>
>Checking my build log from 2002-11-05, I see it worked
>for me with a slightly different setup:
> win2k
> g++.EXE (GCC) 3.2 (mingw special 20020817-1)
> wxWindows 2002-11-01 CVS
>
>Here's the command line, which produced no diagnostics.
>The makeg95.env file used was probably a little different
>from the default because I've been tweaking it. Maybe the
>defines will help you find something that works (the
>compiler options won't, and don't bother messing with
>'-fno-pcc-struct-return' in particular).
>
>gcc --pipe -c -D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400
> -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -I../../lib/mswd
> -I../../include -I../../contrib/include -I../../src/regex
> -I../../src/png -I../../src/jpeg -I../../src/zlib
> -I../../src/tiff -I../../include/wx/msw/gnuwin32
> -DSTRICT -D__WXMSW__ -D__WINDOWS__ -g -D__WXDEBUG__
> -Wall -fno-pcc-struct-return -fno-rtti -fno-exceptions
> -o ../../src/msw/fontenum.o ../../src/msw/fontenum.cpp
>
>I would guess that '-D__GNUWIN32__' might have something
>to do with it, but that's just a wild guess.
>
>In this instance, I was using the canned makefiles,
>not './configure ; make'. Those two approaches do
>different things, and I'm trying to make them more
>compatible. I mostly use mingw, but cygwin should be
>almost if not exactly the same.
>
>
>
>>Curious about the mysterious conversion to an identical prototype I
>>changed the code by :
>>
>>< int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
>>---
>> > int CALLBACK wxFontEnumeratorProc(const LOGFONTA *lplf, const
>>TEXTMETRICA *lptm,
>>and
>>< ::EnumFontFamiliesEx(hDC, &lf, (wxFONTENUMPROC)wxFontEnumeratorProc,
>>---
>> > ::EnumFontFamiliesEx(hDC, &lf, wxFontEnumeratorProc,
>>
>>
>
>The sourceforge site is down right now; otherwise I'd
>check CVS to see if anything changed recently. Does
>your copy of the source file look like the following
>around the line where you had a problem?
>
>#elif (defined(__GNUWIN32__) && !defined(__CYGWIN10__) && !wxCHECK_W32API_VERSION( 1, 1 ))
> #if wxUSE_NORLANDER_HEADERS
> #define wxFONTENUMPROC int(*)(const LOGFONT *, const TEXTMETRIC *, long unsigned int, LPARAM)
> #else
> #define wxFONTENUMPROC int(*)(ENUMLOGFONTEX *, NEWTEXTMETRICEX*, int, LPARAM)
> #endif
>#else
>
>Maybe the code is OK but the macros aren't set up
>correctly for your version of cygwin? We're using
>essentially the same gcc version, so I think the
>problem is which path is taken through the
>conditionally-compiled block.
>
>Please let me know whether you discover anything
>new. If not, I can try to look into it tomorrow.
>Are you using the './configure' approach or the
>distributed makefiles?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wx-dev-un...@lists.wxwindows.org
>For additional commands, e-mail: wx-de...@lists.wxwindows.org
>
>
>
>
>

--
Dave, Diane & Kringle
http://www.geocities.com/SiliconValley/7499
AIM: dstrollope

Reply all
Reply to author
Forward
0 new messages