Compiling SVN-wxMax on Vista Ultimate/32

BlitzMax Forums/Brucey's Modules/Compiling SVN-wxMax on Vista Ultimate/32

Winni(Posted 2008) [#1]
I've successfully compiled wxWidgets, but wxMax on Vista in VMWare Fusion gives me this:

Compiling:wxgauge.bmx
flat assembler  version 1.67.26  (1071152 kilobytes memory)
3 passes, 23766 bytes.
Archiving:wxgauge.debug.mt.win32.x86.a
ar: creating C:/Program Files/BlitzMax/mod/wx.mod/wxgauge.mod/wxgauge.debug.mt.w
in32.x86.a
Compiling:glue.cpp
In file included from C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp:2
3:
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.h:46: error: `wxGCDC' does
not name a type
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp: In constructor `MaxGCD
C::MaxGCDC(const wxWindowDC&)':
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp:28: error: class `MaxGC
DC' does not have any field named `gcDC'
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp:30: error: `gcDC' was n
ot declared in this scope
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp: In constructor `MaxGCD
C::MaxGCDC(const wxMemoryDC&)':
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp:35: error: class `MaxGC
DC' does not have any field named `gcDC'
C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/glue.cpp:37: error: `gcDC' was n
ot declared in this scope
Build Error: failed to compile C:/Program Files/BlitzMax/mod/wx.mod/wxgcdc.mod/g
lue.cpp


How can I fix this?
(And I promise I'll have more questions tomorrow, when I'll be compiling wxMax on Ubuntu 8.04, also in VMWare Fusion.)


Brucey(Posted 2008) [#2]
Ah.... yes. Building on Win32 requires a bit more effort these days, since I've added the graphics context stuff.

You need to compile wxWidgets with the graphics context enabled.

So you'll need this : http://wxmax.googlecode.com/files/gdiplus_headers.zip
(these come from the Windows SDK, which I had to install and find first... which also had to be "tweaked" in order to work)
Oh, there's also something important to *fix* in wxWidgets itself, which I appear to have neglected to write down anywhere... but you'll find it when you try to compile. (I vaguely remember something to do with an abs() call which needs to be changed to absf() or fabs()....)

Which you can extract to *somewhere* in an included folder. I generally just dump it into my MinGW/include dir.
It's only required for building wxWidgets, so we don't need it specifically for wxMax.

Why do we want wxGCDC and wxGraphicsContext? Well, it gives us some improved GDI drawing on Win32 - like antialising and alpha - which gets it up to the same standard as Mac and Linux.


Yeah, I *really* need to update my build notes :-p


Brucey(Posted 2008) [#3]
In msw/graphics.cpp, you will need to edit this:
void wxGDIPlusPathData::AddArc( wxDouble x, wxDouble y, wxDouble r, double startAngle, double endAngle, bool clockwise )
{
    double sweepAngle = endAngle - startAngle ;
    if( abs(sweepAngle) >= 2*M_PI)
    {
...

and change the abs to fabs...
void wxGDIPlusPathData::AddArc( wxDouble x, wxDouble y, wxDouble r, double startAngle, double endAngle, bool clockwise )
{
    double sweepAngle = endAngle - startAngle ;
    if( fabs(sweepAngle) >= 2*M_PI)
    {
...



Winni(Posted 2008) [#4]
Weird. I didn't change any source files, but it compiled anyhow now.

BUT I am getting this, which does not really surprise me, because there is no gdiplus.dll anywhere on my Vista VM:

Building aui
Compiling:aui.bmx
flat assembler  version 1.67.26  (1155308 kilobytes memory)
4 passes, 76307 bytes.
Linking:aui.exe
C:/Program Files/BlitzMax/bin/ld.exe: cannot find -lgdiplus
Build Error: Failed to link C:/Program Files/BlitzMax/mod/wx.mod/samples/aui.exe
Process complete


By the way, my other VM is currently building wx on Ubuntu 8. It was a pain in the $/(!" to find all those libs and dependencies and whatever else.


Winni(Posted 2008) [#5]
Ok. Building wxMax on Ubuntu 8 fails with one million or so error messages. I can't even scroll up to the beginning of them in the Terminal window.

I can't for the life of my understand why some people like Linux. Nothing. Ever. Works. Then again, maybe that's exactly the reason why; it's like fixing that Harley Davidson every single day...


Brucey(Posted 2008) [#6]
Well, that's a bummer...

Perhaps you can leave out

Import "-lgdiplus"

from wx.mod/common.bmx

:-/


Brucey(Posted 2008) [#7]
Building wxMax on Ubuntu 8 fails with one million or so error messages.

Assuming everything is in the right place, and you are using the same version of gcc to build both, I wouldn't expect too many errors.


Brucey(Posted 2008) [#8]
I just tried removing the Import from my XP build, and it don't like it at all...

Which is a bit of a shame.


If you can confirm it works for you without the Import, then at least that's something to work on, otherwise I may as well remove the feature for Win32 altogether.


Winni(Posted 2008) [#9]
It probably is just one error somewhere, but it shows me dozens of "wxglue.cpp: error: syntax error" messages, and there are so many of them that I cannot see with what it starts.

By the way, after applying the source code change above, I am now getting errors compiling wxWidgets on Windows. Stuff like "GdiplusShutdown" was not declared in this scope and "expected primare-expression before )" and so on. How can that happen after changing only one letter?


Brucey(Posted 2008) [#10]
By the way, after applying the source code change above, I am now getting errors compiling wxWidgets on Windows

Perhaps Vista doesn't require that "fix", which was certainly needed on XP to get it to compile here.

Ho hum...


Winni(Posted 2008) [#11]
Oh, I guess it was just me, Mr Smarty... It didn't find the gdiplus headers - I had them in a sub directory named "gdiplus_headers" in MinGW's include folder, and it didn't look for them there.

After fixing that, I got the compiler error for which you posted the fix up there.

Now it compiled.

Max still complains about the missing -lgdiplus. I am now recompiling it without the Import statement.


Winni(Posted 2008) [#12]
Ok, the Vista build now works!!

Going back to Linux...


Winni(Posted 2008) [#13]
Ah! I forgot to copy setup.h to include/wx. Now it compiles on Linux as well.


Brucey(Posted 2008) [#14]
Ok, the Vista build now works!!

Without the Import?

Dunno how I'm going to fix that then... cuz it's definitely required for < Vista....


Winni(Posted 2008) [#15]
Yes, without the Import.

I don't know, maybe Mark can add a ?Vista condition flag... There are so many differences between pre-Vista systems and Vista, it would probably come in handy in many situations.


Brucey(Posted 2008) [#16]
maybe Mark can add a ?Vista condition flag


Well, with my BMK-NG, I could probably hack something up to do it based on your current OS version, but I really don't want to go back to having to rely on a non-default BMK at this time.

I guess for now, I add notes : if you are building on Vista, comment out this...

No big deal, I suppose.


Brucey(Posted 2008) [#17]
Ahh, I may have solved the problem... or, I should probably do as Homer Simpson... D'oh!

GCC likes .a files for dlls, a link time. You probably don't have the libgdiplus.a file, and hence it complains about -lgdiplus.

Mind you, without the file, I would expect you to get link errors. Which implies your wxWiddgets build settings are not including GDI+ integration.

Anyhoo, there's a libgdiplus.a file available in the win32 static libs distribution.
Come to think of it, that file probably wants to be included in the headers release too - just in case someone wants to build with it :-p

Adding that file (to the win32/lib dir) should fix your build problem.

*sigh*... this is what happen when one fails to keep ones notes in order ;-)


Winni(Posted 2008) [#18]
Um, I think it is configured to use GDI Plus, at least I changed the settings in two files from 0 to 1, so it -should- use it. I don't have the VM running right now; when I do, I can post the files here and check once more.


Brucey(Posted 2008) [#19]
I don't have the VM running right now

Heh... I just kicked mine off to have a peek in the lib folder, as I had a horrible feeling that this was the reason... and there it was, libgdiplus.a, sitting there at the top...

Funny thing is, I don't even remember building that file from the dll... which I would have had to do... I think I need a holiday :-p


Winni(Posted 2008) [#20]
Here's what my config.gcc says:

# Link with gdiplus.lib? (Needed for wxGraphicsContext, will also set wxUSE_GRAPHICS_CONTEXT) [0,1]
USE_GDIPLUS := 1


And that's the relevant part in setup.h:

// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced
// 2D drawing API.  (Still somewhat experimental)
//
// Please note that on Windows you will need to link with gdiplus.lib (use
// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your
// application if you want it to be runnable on pre-XP systems.
//
// Default is 0
//
// Recommended setting: 1
#ifndef wxUSE_GRAPHICS_CONTEXT
#define wxUSE_GRAPHICS_CONTEXT 1
#endif



And these are the GDIPlus.dll files on my Vista VM:

C:\>dir gdiplus.dll /s
 Volume in drive C is Vista
 Volume Serial Number is BC28-1234

 Directory of C:\Program Files\Microsoft Office\OFFICE11

25.07.2008  17:15         1.693.184 GDIPLUS.DLL
               1 File(s)      1.693.184 bytes

 Directory of C:\Users\Winni\AppData\Local\Temp\UTPSDLL

11.01.2007  05:17         1.712.128 GdiPlus.dll
               1 File(s)      1.712.128 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.0.6000.16386_none_9ea0ac9ec96e7127

02.11.2006  11:38         1.744.896 GdiPlus.dll
               1 File(s)      1.744.896 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.0.6000.16683_none_9ea0f08ac96e2537

30.04.2008  07:24         1.744.896 GdiPlus.dll
               1 File(s)      1.744.896 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.0.6000.20826_none_87cd0392e31b3a67

01.05.2008  05:16         1.744.896 GdiPlus.dll
               1 File(s)      1.744.896 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.0.6001.18000_none_9e752e5ac9c619f3

18.01.2008  23:26         1.748.992 GdiPlus.dll
               1 File(s)      1.748.992 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.0.6001.18065_none_9e7abe2ec9c13222

30.04.2008  07:27         1.748.992 GdiPlus.dll
               1 File(s)      1.748.992 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.0.6001.22170_none_87ae89a0e3672b5a

01.05.2008  05:22         1.748.992 GdiPlus.dll
               1 File(s)      1.748.992 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.1.6000.16386_none_8df21b8362744ace

02.11.2006  11:38         1.821.696 GdiPlus.dll
               1 File(s)      1.821.696 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.1.6000.16683_none_8df25f6f6273fede

30.04.2008  07:24         1.823.232 GdiPlus.dll
               1 File(s)      1.823.232 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.1.6000.20826_none_771e72777c21140e

01.05.2008  05:16         1.823.232 GdiPlus.dll
               1 File(s)      1.823.232 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.1.6001.18000_none_8dc69d3f62cbf39a

18.01.2008  23:26         1.823.232 GdiPlus.dll
               1 File(s)      1.823.232 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.1.6001.18065_none_8dcc2d1362c70bc9

30.04.2008  07:27         1.823.232 GdiPlus.dll
               1 File(s)      1.823.232 bytes

 Directory of C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1
.1.6001.22170_none_76fff8857c6d0501

01.05.2008  05:22         1.823.232 GdiPlus.dll
               1 File(s)      1.823.232 bytes

     Total Files Listed:
              14 File(s)     24.824.832 bytes
               0 Dir(s)  117.913.784.320 bytes free

C:\>


Somehow I have the feeling that none of them are actually used by or related to wxWidgets.