Help getting WxMax running

BlitzMax Forums/Brucey's Modules/Help getting WxMax running

dynaman(Posted 2016) [#1]
I tried using the WxMax win32 bin release, extracted it, placed the Wx.Mod folder in the blitmax/mods directory and tried to run the about box example. It gave a LONGGGG list of errors starting with the following.

Linking:aboutbox.exe
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x28): undefined reference to `__gxx_personality_sj0'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x47): undefined reference to `_Unwind_SjLj_Register'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x906): undefined reference to `_Unwind_SjLj_Unregister'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0xa39): undefined reference to `_Unwind_SjLj_Resume'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0xffe): undefined reference to `__gxx_personality_sj0'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x1014): undefined reference to `_Unwind_SjLj_Register'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x1044): undefined reference to `_Unwind_SjLj_Unregister'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x107a): undefined reference to `_Unwind_SjLj_Resume'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x109a): undefined reference to `__gxx_personality_sj0'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x10be): undefined reference to `_Unwind_SjLj_Register'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x1976): undefined reference to `_Unwind_SjLj_Unregister'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x1aa9): undefined reference to `_Unwind_SjLj_Resume'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2073): undefined reference to `__gxx_personality_sj0'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2091): undefined reference to `_Unwind_SjLj_Register'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2730): undefined reference to `_Unwind_SjLj_Unregister'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2864): undefined reference to `_Unwind_SjLj_Resume'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2c2e): undefined reference to `__gxx_personality_sj0'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2c44): undefined reference to `_Unwind_SjLj_Register'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2cb5): undefined reference to `_Unwind_SjLj_Unregister'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xh_frame.o):xh_frame.cpp:(.text+0x2cf5): undefined reference to `_Unwind_SjLj_Resume'


Do I need to install mingw or another C++ compiler to get it working? I thought since it was pre-compiled that would not be needed.

Thanks in advance for any help!


RustyKristi(Posted 2016) [#2]
I was also into creating an interface using BMX + wxMax and having problems building it so I got this on hold and I'm interested in finding out the latest solution on how to properly build this as well.


xlsior(Posted 2016) [#3]
FWIW, it does compile with MinGW 5.1.0 and BMX-NG (Which is what Brucey does most of his ongoing development/testing with these days, I'm sure)

If you use stock BlitzMax, you'll probably have to use one of the older WX releases for it to compile.


Henri(Posted 2016) [#4]
Hi,

something to try: <instructions>.

-Henri


Derron(Posted 2016) [#5]
SjLj - Short jump Long jump

You are using the wrong MinGW-exception-handling-variant: There is dwarf (which you are using) and sjlj.

bye
Ron


dynaman(Posted 2016) [#6]
So I still need the new mingw compiler even with precompiled binaries? I am totally new with using 3rd party mods.

Thanks again everyone


Henri(Posted 2016) [#7]
Yes.

Chances are that those binaries were compiled with different version of MinGW than BlitzMax basic binaries. But if you follow the instructions that I posted and don't set the path enviroment variable upon MinGW setup, it doesn't interfere with any existing MinGW setups.

-Henri


dynaman(Posted 2016) [#8]
Thanks Henri. That makes sense, I should have caught that earlier. I will give those instructions a try tonight.


dynaman(Posted 2016) [#9]
Hopefully just one last error. I got to step 6 in the instructions and the compile for the rarinputstream is failing on the archive.cpp file. I add the
#include <stdint.h>
line to crc.hpp and that did not help.

Here is the error text I am getting, the SOLE_AUTHENTICATION_SERVICE seems to be the problem. Looking it up online too but any help is welcome.

:/BlitzMax/MinGW32/x86_64-w64-mingw32/include/combaseapi.h:230:79: error: 'SOLE_AUTHENTICATION_SERVICE' has not been declared
WINOLEAPI CoInitializeSecurity (PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE *asAuthSvc, void *pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void *pAuthList, DWORD dwCapabilities, void *pReserved3);
^
C:/BlitzMax/MinGW32/x86_64-w64-mingw32/include/combaseapi.h:255:60: error: 'SOLE_AUTHENTICATION_SERVICE' has not been declared
WINOLEAPI CoQueryAuthenticationServices (DWORD *pcAuthSvc, SOLE_AUTHENTICATION_SERVICE **asAuthSvc);
^
Build Error: failed to compile C:/BlitzMax/mod/wx.mod/wxrarinputstream.mod/src/unrar/archive.cpp


Henri(Posted 2016) [#10]
Hmmm...just tried it out on a blank computer and it seemed to work.
Where did you get the wx.mod ?

-Henri


grable(Posted 2016) [#11]
You can find the struct SOLE_AUTHENTICATION_SERVICE here (atleast for 5.1.0):
/mingw/x86_64-w64-mingw32/include/objidl.h
and
/mingw/x86_64-w64-mingw32/include/objidlbase.h

Both are behind some defines though, which looks to be checking for whether your application is for DESKTOP or APP mode.
Im not sure, but the interface that uses it IClientSecurity might be for APPS only, unless the family is set to both modes.

See /mingw/x86_64-w64-mingw32/include/winapifamily.h for the family defines.


dynaman(Posted 2016) [#12]
Going to give it a new try from scratch tonight. I'll keep track of versions used for everything. I had a mingw path and environment variables able setup from years ago that may have messed it up


Henri(Posted 2016) [#13]
Just a sidenote: I believe that MaxIDE requires enviroment variable named 'MinGW' were value is the path to MinGW folder in order to enable 'Build Modules' - menu option.
Brucey's BMK searches MinGW files from the <Blitzmax dir>\MinGW32 by default so it doesn't matter what MinGW folder is in the 'Path' variable. No other variables should be required.

-Henri


LT(Posted 2016) [#14]
I'm having this same problem with TheoraPlayer. Used to work, but it's been awhile since I've done anything with video.

I'm running on a 32-bit machine...not sure if I can go by your instructions, Henri. I'm pretty sure I'm using the correct version of MinGW and have compiled everything with no issues, but I'm getting the same errors as OP.

EDIT: There have been so many versions of things floating around that I can't keep track.. :(

EDIT 2: The version I'm using is the tdm-gcc-5.1.0-3.exe download. I think I tried tdm64-gcc-5.1.0-2.exe at one point, but had issues. I know I did a clean install (six months ago) and recompiled ALL of the modules I'm using. But now that I'm adding TheoraPlayer to the mix, I'm having the same ole 'undefined reference' problems. This Theora is the NG version, unlike what was working before.

Is there any reason I should expect Theora NG to not be working with TDM 32-bit?


Henri(Posted 2016) [#15]
Hi LT,

these 'undefined errors' are almost always the result of mixed versions of MinGW libs or build tools. If you are using regular BMK (the make tool in BlitzMax\bin folder) then you have to make sure that:

1. Windows system enviroment variable called 'MinGW' holds the value of your MinGW folder like 'C:\MinGW'.

2. Windows 'path' variable holds only one entry of previously mentioned MinGW's bin folder like 'C:\MinGW\bin'. One root of problems is that there are more than one entry.

3. Move all the libs from 'BlitzMax\lib' folder to safe location, and then copy all the libs from MinGW folder to BlitzMax\lib folder.

4. Move ar.exe and ld.exe from BlitzMax\bin folder to safe location, and again copy these files from MinGW\bin folder to BlitzMax\bin folder.

5. Finally rebuild all modules and then run some samples to test that everything is working.

These might seem like very basic steps, but even the best sometimes overlook these. All that is needed is one missed file or one missed reference.
When you are sure that the base is clean you can start adding extra modules and see if they work. If they don't then chance's are they hold library files also that were compiled in some different version of MinGW compiler.


I'll try the Theora and see how it goes..

-Henri


LT(Posted 2016) [#16]
Hi, Henri. Thanks for replying.

I did all the steps six months ago and Theora's the only one giving me trouble, at the moment. I dug around and found an old version and it works (well, the example does). But I tried recompiling it and the same problem occurred. Pretty strange, since all of the modules have been compiled using the same MinGW so this shouldn't be an issue, afaik. I guess I must have missed something.

I'm assuming that my use of the 32-bit version of MinGW is okay..?


Henri(Posted 2016) [#17]
Older versions of modules seem to work better with strictly 32-bit variant , but newer versions might require 64-bit variant (like wx). If I'm not mistaking Brucey uses TDM 5.1 64-bit version with special BMK that knows to use 32-bit variant in 32-bit enviroment. Theoratically 64-bit version holds both variants, the linker just needs to know which to use.

When I tried 32-bit 4.7 version I got the same _unwind errors. But when I compiled with NG version that uses 64-bit 5.1 version it compiled ok. Also the examples worked (if you don't count 'index out of bounds' and small tiny MAV :)) , but all in all seemed fine. The video did play.

-Henri


LT(Posted 2016) [#18]
Thanks for looking into it. I'm glad someone got the same errors so I know I'm not crazy (or stupid). ;)

I am using the special BMK, but not NG. Perhaps I ought to have another go at 64-bit.


LT(Posted 2016) [#19]
Update: Seems to work just fine with NG. :)

Are there any IDE options for NG besides MaxIDE? My understanding is that it doesn't work with Blide, but please correct me if I'm wrong.


Derron(Posted 2016) [#20]
It should work with NG - you just do not get the custom parameters (other targets, "quick"-build - which skips module-recompilation-need-checks)...

Normal coding and compiling should be still doable with Blide - but of course you already tried it with Blide before asking and ... failed? :-)


bye
Ron


LT(Posted 2016) [#21]
but of course you already tried it with Blide before
No, I haven't tried it with Blide (been using command line). I got the impression it wouldn't work from another thread. Of course, things like quick build and other targets are desirable features. Guess I'll stick to the special BMK for now and use MaxIDE with the NG version.


dynaman(Posted 2016) [#22]
I am trying again today. I am up to the point where I add WX-Max. Before that I tried a couple of samples that come with blitz. The Digesteroids example starts but never shows anything, the maxgui glcube mod does not link and the breakout program works fine. Is this normal? Would I need to do some changes to get glcube and digesteroids to work?


Derron(Posted 2016) [#23]
vanilla BlitzMax should work out of the box.
If you recompiled modules with your MinGW setup then things might differ.

Did it work with vanilly BMX or does it fail there too?

Try to use "directX" if opengl is failing for you (blame the drivers and windows).


bye
Ron


dynaman(Posted 2016) [#24]
They worked just fine with Vanilla blitzmax, I'm keeping a separate folder for that as well in case I need to switch back. WxMax compiled without error this time, going to try some samples now.


dynaman(Posted 2016) [#25]
Tried the glcube in wxmax example and got an error about C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw31u_gl.a(gllib_glcanvas.o):glcanvas.cpp:(.text+0x7aa): undefined reference to `_imp__wglGetCurrentDC@0'

Any advice?

Other examples have worked, trying them out one at a time. Thanks for all the help so far everyone!