Problem compiling wxMax on Mavericks xCode5

BlitzMax Forums/Brucey's Modules/Problem compiling wxMax on Mavericks xCode5

Pete Rigz(Posted 2013) [#1]
Hello :) Anyone tried compiling wxMax on the latest MacOS and xcode version 5?

I'm getting the following error:

/Applications/BlitzMax149/mod/wx.mod/wx.mod/wxglue.cpp:73:12: error: variable
length array of non-POD element type 'wxString'
wxString t[n];

Thanks!


Pete Rigz(Posted 2013) [#2]
Well doing a little bit of hunting around on the interwebs I found this http://trac.macports.org/ticket/40386 and so changed:

wxString t[n];


to

wxString *t=new wxString[n];


in the wxglue.cpp file and that seemed to do the trick, not that I really know what I'm doing! Anyway, it's just hit the same error in a different file so I'll see how far I can get by doing a similar fix as they crop up...


Pete Rigz(Posted 2013) [#3]
In the end it was just 4 files that needed editing in the end. I put them all into a zip file here: http://www.rigzsoft.co.uk/files/wx.mod.zip

All seems to compile fine now, however TimelineFX is crashing on running, as are some samples such as mediaplayer sample. Off to bed now though will take another look at that tomorrow.


Pete Rigz(Posted 2013) [#4]
It it seems to me that it's something in the wxStream module or maybe the wximage mod. It crashes on the bmx_wximage_createfromstream command. Having said that though in the media player it crashes on adding the mediactrl to a sizer.. Strangeness is afoot...

I'm compiling this with the modified bmk and a wx build with the community IDE.


Here's the stack strace when timelinefx crashes:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib      	0x90f13d68 longjmp + 4
1   TPEditor                      	0x000c8730 png_error + 96
2   TPEditor                      	0x000c5d3c png_create_read_struct_2 + 460
3   TPEditor                      	0x000c5b5e png_create_read_struct + 62
4   TPEditor                      	0x006ae135 wxPNGHandler::LoadFile(wxImage*, wxInputStream&, bool, int) + 115
5   TPEditor                      	0x006a1ff1 wxImage::DoLoad(wxImageHandler&, wxInputStream&, int) + 361
6   TPEditor                      	0x00693533 wxImage::LoadFile(wxInputStream&, wxBitmapType, int) + 1535
7   TPEditor                      	0x003e8392 bmx_wximage_createfromstream + 66
8   TPEditor                      	0x003e1916 233 + 114
9   TPEditor                      	0x003e167f _wx_wxbitmap_wxBitmap_CreateFromFile + 71
10  TPEditor                      	0x00049adb 18683 + 48
11  TPEditor                      	0x001eea21 177 + 11
12  TPEditor                      	0x000047f7 _bb_TP_App_OnInit + 125
13  TPEditor                      	0x003c6f51 _wx_wxapp_wxApp__OnInit + 34
14  TPEditor                      	0x003efeac MaxApp::OnInit() + 28
15  TPEditor                      	0x005dddc2 wxApp::CallOnInit() + 32


and when media control crashes:

0   mediaplayer                   	0x0017000e wxWindow::DoGetSize(int*, int*) const + 38
1   mediaplayer                   	0x0029d190 wxSizerItem::DoSetWindow(wxWindow*) + 148
2   mediaplayer                   	0x002a027b wxSizerItem::wxSizerItem(wxWindow*, int, int, int, wxObject*) + 231
3   mediaplayer                   	0x0001f7c1 bmx_wxsizer_add + 65
4   mediaplayer                   	0x000190e7 _wx_wxwindow_wxSizer_Add + 53
5   mediaplayer                   	0x00002d25 193 + 45
6   mediaplayer                   	0x0000b1fb 177 + 11
7   mediaplayer                   	0x00002b26 _bb_MyApp_OnInit + 94
8   mediaplayer                   	0x000166a1 _wx_wxapp_wxApp__OnInit + 34
9   mediaplayer                   	0x0003fa7c MaxApp::OnInit() + 28
10  mediaplayer                   	0x001a1b02 wxApp::CallOnInit() + 32
11  mediaplayer                   	0x000ebbde wxEntry(int&, wchar_t**) + 94
12  mediaplayer                   	0x000ebcb2 wxEntry(int&, char**) + 50
13  mediaplayer                   	0x000405a4 bmx_app_wxentry + 36
14  mediaplayer                   	0x000166ec _wx_wxapp_wxApp_Run + 11



Pete Rigz(Posted 2013) [#5]
Just made some progress, suddenly occurred to me that my freeimage.mod might be out of date of my mac and it was. Got the latest version but it wasn't compiling - ImfAutoArray.h was throwing an error that memset wasn't visibe. I noticed that string.h was only being included if mingw was defined so forced it to be included and that seemed to do the trick.

TimelineFX now throws the following error in the output window:

duplicate symbol _jpeg_std_message_table in:
    /Applications/BlitzMax149/mod/bah.mod/freeimage.mod/freeimage.release.macos.x86.a(jerror.c.release.macos.x86.o)
    /Applications/BlitzMax149/mod/wx.mod/lib/macosx86/libwxjpeg-2.9.a(wxjpeg_jerror.o)
duplicate symbol _jinit_marker_reader in:
    /Applications/BlitzMax149/mod/bah.mod/freeimage.mod/freeimage.release.macos.x86.a(jdmarker.c.release.macos.x86.o)
    /Applications/BlitzMax149/mod/wx.mod/lib/macosx86/libwxjpeg-2.9.a(wxjpeg_jdmarker.o)
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Which is at least better then a macos crash report :)

Update: I fixed those errors by renaming jpeg_std_message_table and jinit_marker_reader in the freeimage.mod.

So now the problem is being able to load images, so maybe it's that my hack didn't really work but I'm not sure, here's the long list of errors I'm getting now:




Pete Rigz(Posted 2013) [#6]
Sorry to keep hammering this thread :) So It seems to be that freeimage.mod isn't playing nice with wx widgets, something must be clashing somewhere.

I imported freeimage.mod to the splash sample and it throws the same error. However I reverted freeimage back to revision 1371 from January and it works fine, timelineFX is now working on mavericks, yay! Albeit with a few tweaks being needed here and there to the ui, this is the first time I've compiled with version 2.9.5.

I updated my windows version to the latest freeimage and that also crashes with the same error, so maybe the things you implemented to avoid multi-library -version problems has upset it...

Phew, that was an adventure :)


Brucey(Posted 2013) [#7]
I guess I need to update to Mavericks... which is a bit of a pain - either update and keep up-to-date, but lose support for other versions, or don't update, and have issues getting things working on new versions... :-/


Pete Rigz(Posted 2013) [#8]
Yeah, I don't envy you on that one! I will have to test to see if a mavericks build of TimelineFX runs on previous versions, otherwise I'll have to provide the old version as well.

There seems to be some kind of font issue in widgets as well, the system font has changed in someway, it's being reported across all wx implementations on mavericks, ie: http://wxpython-users.1045709.n5.nabble.com/another-possible-issue-with-new-Mac-OS-Mavericks-td5719024.html


Brucey(Posted 2013) [#9]
Thanks for your "fixes" for the build issues on Mavericks.

wxString *t=new wxString[n];

You shouldn't be doing this really - unless you are subsequently deleting the array afterwards. Otherwise, it's a big memory leak.
I'll go through them and remove the [] array stuff, and make it into something else.


Brucey(Posted 2013) [#10]
I've updated the freeimage module, changing the prefixes for those two variables.


Pete Rigz(Posted 2013) [#11]
I got the latest version but when I compile it I'm getting the error about memset above -


Got the latest version but it wasn't compiling - ImfAutoArray.h was throwing an error that memset wasn't visibe. I noticed that string.h was only being included if mingw was defined so forced it to be included and that seemed to do the trick.



Are you getting that as well?


Brucey(Posted 2013) [#12]
Are you getting that as well?

I did. I appear to not have checked the change in yet for some reason. Well, I've been using several different machines/environments for testing, which have raised different issues in different places.
Keeps me on my toes, I suppose :-)

You can assume it will be committed shortly.


Pete Rigz(Posted 2013) [#13]
That's just not good enough ;)

Yeah it's fine now, thanks.