Getting wx.mod to work?

BlitzMax Forums/Brucey's Modules/Getting wx.mod to work?

Amon(Posted 2008) [#1]
Hi! I followed the tuts on the google site and used svn to download wx.

When I checked out it downloaded a whole load of folders to my BlitzMax/mod folder all for wxGUI.

There is a wx.mod folder and loads of other wx folders. Do I move every other wx folder in to the wx.mod folder and then try and build the module?

Is there a step by step intruction on how to do it, please?


DavidDC(Posted 2008) [#2]
Sounds like you made a mistake with your svn settings. wx.mod is the only new folder added to BlitzMax/mod. All those other wx folders should be inside wx.mod.


Amon(Posted 2008) [#3]
Yep I was using svn wrong. I've now downloaded and built the module succesfully.

Thanks! :)


flytom1(Posted 2008) [#4]
Hey there...

i read the tuts serval times but i can't get the wx work.
i would like to check for the latest moduls, but it failed with this error message:

Process Failure with svn check out/update c:\Programme\BlitzMax\mod\wx.mod

BlitzMax Version 1.28
WinXP SP2

Looking forward for your help.

thanks
tom


Brucey(Posted 2008) [#5]
Are you trying to checkout from the command-line, or with a tool like TortoiseSVN?

Or, this should work, assuming you've got the subversion client installed :

In your command-line console go to c:\Programme\BlitzMax\mod\

Enter the following :
svn checkout http://wxmax.googlecode.com/svn/trunk/wx.mod wx.mod

All going well, that should create you a folder called wx.mod, in the correct place, with all the correct modules.

Next, you need to get the includes and static libraries. The install instructions should tell you where those go.

Once everything is set up, Build Modules, and wait.... and wait... and wait a bit more...

After that, you should try building one of the included samples.

:o)


flytom1(Posted 2008) [#6]
Hi Brucey,

thanks for the very quick answer.

I thought SVN should run under the Max IDE -> Project Manager. Cause there you'll find also the svn checkout mode and update mode...
With the downloaded SVN 1.4.6 programm it works perfectly.

Now i've all mods downloaded and compiled. if i open now one of the sample and build that, bmx give that back:

Building aboutbox
Linking:aboutbox.debug.exe
C:/Programme/BlitzMax/bin/ld.exe: cannot find -lwinspool
Build Error: Failed to link C:/Programme/BlitzMax/mod/wx.mod/samples/aboutbox.debug.exe
Process complete

All build options enabled.

BMax 1.28
WinXP SP2

greez
tom


Artemis(Posted 2008) [#7]
If you have MinGW installed then just copy "MinGW\lib\libwinspool.a" into "BlitzMax\lib".


flytom1(Posted 2008) [#8]
Thank you ArtemisX.

Something must be wrong. Now i get this message:

C:/Programme/BlitzMax/bin/ld.exe: cannot find -lrpcrt4


Has somebody an Idea?


greez
Tom


Brucey(Posted 2008) [#9]
There may be a file called librpcrt4.a that you'll need to copy also.

Am still not sure why some people are having to copy these files. I never have, on XP or Win2k.
Is this a BlitzMax installation problem, or a MinGW problem?

:-(


Yahfree(Posted 2008) [#10]
Hmm sorry to add to the not building thread, but it won't build for me either..

I've gotten all the files/librarys/headers, and placed correctly as per that one guide from artemis.

But when i try to build VIA "bmk makemods wx" on command prompt, i get alot of errors, then at the end i get this:

"Build Error: failed to compile D:/programming/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp"

It compiles keys.bmx, and consts.bmx right before the error though..

Help?

Edit: additional info:

complete list of errors:

D:/programming/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp: In function `BBString* bbStringFromWxString(const wxString&)':
D:/programming/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp:55: error: invalid conversion from `const wchar_t*' to `const BBChar*'
D:/programming/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp: In function `BBString* bmx_wxkeyevent_getunicodekey(wxKeyEvent&)':
D:/programming/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp:1343: error: 'class wxKeyEvent' has no member named 'GetUnicodeKey'
Build Error: failed to compile D:/programming/BlitzMax/mod/wx.mod/wx.mod/wxglue.cpp


also: I have 2 wxglue.cpp files in that directory, with different file sizes... I've re-grabbed all the files, and still having the same problem...

additionaly, i've also tried building in the BM IDE, still the same results.


Yahfree(Posted 2008) [#11]
Edit:

Ok its compiled, but this is what happens when I try to run a sample... For example aboutbox.bmx:

Building aboutbox
Compiling:aboutbox.bmx
flat assembler  version 1.66
3 passes, 25138 bytes.
Linking:aboutbox.debug.exe
D:/programming/BlitzMax/bin/ld.exe: cannot find -lwinspool
Build Error: Failed to link D:/programming/BlitzMax/mod/wx.mod/samples/aboutbox.debug.exe
Process complete


any ideas?


Yahfree(Posted 2008) [#12]
Ok, well I finaly got it to work; had to drag those library files to the lib/win32 in the wx.mod dir..


All i can say is WOW, how the hell do you do all this Brucey? amazing.

anyways, any tutorials on this stuff? lots to take in


Brucey(Posted 2008) [#13]
Sorry about the setup problems... it's only happening to a few installations, which must be different somehow.

As for tutorials, you might find the book mentioned HERE
You can download the PDF for free.

Although it's mostly focussed on C++ programming, the two are close enough (wxMax and the C++ wxWidgets) that it's easy to translate one to the other without much effort.

The samples themselves give you more of an overview of what you can do with it, but tend to cover the whole usage of a specific control, rather than focus on a small example of implementing it.

Once you get the hang of things, you might also want to check out wxFormBuilder, a free GUI editor. It makes building GUIs easier. There's a small BlitzMax code-generator in the tools folder of wxMax which can load wxFormBuilder project files and create runnable BlitzMax code - can save you a lot of time!

For other tutorials, a lot of C++ based ones online should be easily convertable.

If anyone knows of any good ones, perhaps we can get some converted for wxMax proper?


flytom1(Posted 2008) [#14]
Hi @ All,

now it's also running on my system. Thanks for all answers. Some things which gets missed on my systems were:

libwinspool.a
librpcrt4.a
libodbc32.a

i copy this files from my MinGW/lib to the BlitzMax/lib

and viola. All things running now...
Great Job Brucey. Thanks!

Greez
Tom


Vilu(Posted 2008) [#15]
@Yahfree (or Brucey):

I'm getting exactly the same error you did:



What did you do to fix this problem?

Other modules I have compile just fine. wxMax is the one not getting along with my Vista/MinGW combo. :)


Yahfree(Posted 2008) [#16]
Copy these files:

libwinspool.a
librpcrt4.a
libodbc32.a

From MinGW/lib To BlitzMax/mod/wx.mod/lib/win32

Worked for me...


Brucey(Posted 2008) [#17]
It's interesting, that error. It implies that UNICODE is not specified somewhere.
Are the headers in the correct place?
Are the static libraries in the correct place? (they also include a platform-specific header section)


Vilu(Posted 2008) [#18]
@Yahfree: did that already, didn't help. Still the same error.

@Brucey: I have the headers under
BlitzMax\mod\wx.mod\include\wx and static libraries under
BlitzMax\mod\wx.mod\lib\win32

Today I'll try compiling it on my Win XP machine and see if it does any difference.


Brucey(Posted 2008) [#19]
"error: 'class wxKeyEvent' has no member named 'GetUnicodeKey'"
definitely makes it seem like a Unicode issue.

Hmm.. are you on BlitzMax 1.28?

If not, you'll be needing to use a different version of bmk.


Vilu(Posted 2008) [#20]
Yes, BlitzMax 1.28 with all the modules synced to the latest.


edit: getting the very same error on my XP rig. I guess I'm doing something wrong here.

1. Using Tortoise, checked out the svn repo http://wxmax.googlecode.com/svn/trunk directly into c:\program files\blitzmax\mod\ (letting svn create wx.mod folder)
2. Downloaded the headers (wxwidgets_2.8.7_headers.zip) and unzipped them into BlitzMax/mod/wx.mod/include
3. Downloaded the libs (wxwidgets_2.8.7_static_win32b.zip) and unzipped them into BlitzMax/mod/wx.mod/lib
4. To be on the safe side, copied the three MinGW libraries under wx.mod/lib/Win32
5. Launched "Build modules" from MaxIDE
6. Watched glue.cpp compilation to fail on the same error

Darn.

Here's my MinGW component versions, if it makes any difference:

runtime=mingw-runtime-3.13.tar.gz
w32api=w32api-3.10.tar.gz
binutils=binutils-2.17.50-20060824-1.tar.gz
core=gcc-core-3.4.5-20060117-1.tar.gz
gpp=gcc-g++-3.4.5-20060117-1.tar.gz
g77=
ada=
java=
objc=
make=mingw32-make-3.81-2.tar.gz



Brucey(Posted 2008) [#21]
Plenty of brain-wracking going on here...

Is your MinGW a clean install or an update over an older version?

Going to try a clean install here now...


Brucey(Posted 2008) [#22]
For our next trick...

can you try building it with :
bmk makemods -v -a wx

from the command line. (you might need to be doing that from the BlitzMax/bin folder.)

I get something like :
Compiling:wxglue.cpp
g++ -I"C:/Program Files/BlitzMax/mod/wx.mod/wx.mod" -I"C:/Program Files/BlitzMax/mod" -I"C:/Program Files/BlitzMax/mod/b
rl.mod/map.mod" -I"C:/Program Files/BlitzMax/mod/brl.mod/map.mod" -I"C:/Program Files/BlitzMax/mod/brl.mod/blitz.mod" -I
"C:/Program Files/BlitzMax/mod/brl.mod/system.mod" -I"C:/Program Files/BlitzMax/mod/wx.mod/lib/win32/mswu" -I"C:/Program
 Files/BlitzMax/mod/wx.mod/include" -march=pentium -ffast-math -w -fno-exceptions  -DHAVE_W32API_H -D__WXMSW__ -D_UNICOD
E -c -Os -o "C:/Program Files/BlitzMax/mod/wx.mod/wx.mod/.bmx/wxglue.cpp.debug.win32.x86.o" "C:/Program Files/BlitzMax/m
od/wx.mod/wx.mod/wxglue.cpp"



Vilu(Posted 2008) [#23]
I re-applied the BlitzMax 1.28 patch over my existing installation, did a syncmods and compiled. This time it worked.

I have no clue what I had wrong in both of my Windows installations. No matter, it works now! Thanks for your hard work.


Brucey(Posted 2008) [#24]
Thanks for persevering!

Did the syncmods after re-applying 1.28 again get anything new?


Vilu(Posted 2008) [#25]
Yes, some modules got synced but I didn't take note which ones.

Well, now it's time to get my wxMax serial port app underway :)


Glenn Dodd(Posted 2008) [#26]
My apologies for this but i need to ask a complete beginner question.
I have been using Windows for ages and have Tortoise svn working for wxMax.

I have just installed Ubuntu 8.04 and have followed the instructions in
"Did you see this: http://www.blitzbasic.com/Community/posts.php?topic=54592 ?? "

I now want to svn for wxMax in Ubuntu. I have installed a program called RapidSVN but don't know which option i need to use to get everything. I am also confused about the versions of MinGW and all the other stuff i need.

I have installed BlitzMax v1.18 in a folder called : /home/c2d/BlitzMax and it opens successfully. i haven't tried to compile anything yet.

I am a total newbie for Linux and am afraid i will screw things up without the proper steps to follow.
So far i know how to install programs from the Applications Add/Remove screen and i can launch the Terminal ( i stumbled across the "sudo apt-get install" command for something else, but assume i don't know to use it unless you specifically tell me)
I already have the latest drivers for my NVidia cards.

I really need some concise, simple help.

Regards
Glenn


Glenn Dodd(Posted 2008) [#27]
Just compiled and ran this:
Graphics 800,600

DrawText ("Hello, World!",50,50)
Flip
WaitKey

it ran but gave me this on completion:
Building untitled1
Compiling:untitled1.bmx
flat assembler version 1.64
3 passes, 2681 bytes.
Linking:untitled1.debug
Executing:untitled1.debug
/usr/bin/ld: warning: libstdc++.so.6, needed by /usr/lib/libGLU.so, may conflict with libstdc++.so.5

Process complete

I tried this:

c2d@c2d-desktop-ubuntu:~$ sudo apt-get install libstdc++.so.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package libstdc++.so.6

I have no idea what E: is

I am still on v1.18 of Blitzmax.


Brucey(Posted 2008) [#28]
You can ignore the warning... don't worry about it.

The biggest issue you'll be having if you followed that link you posted previously, is having installed gcc 3.3. You don't need it. gcc 4.x is what comes with your version of Linux. gcc 3.3 is very old (and Mark really needs to change the Linux version to use whatever the user has, really!)

If you want to run any of my modules you'll either be wanting to update to the latest, or at least 1.24/26 with the Tweaked BMK available from my website. (1.28 is the best option tho).


Btw, if you want to do things with wxMax, the default libs available from the downloads section were compiled with gcc 4.x - which won't work with gcc3.3. (just to let you know).


Glenn Dodd(Posted 2008) [#29]
ok
so from this list what do i need to install? obviously not g++-3.3.
then install bmax 1.18 and then get the 1.28 update.
then using svn (rapidSVN) i go to which site to get your mods?
I am a little bit hazy on those steps since it has been ages since i set this up in wondows (tortoisesvn)

Cheers
glenn


Install the following packages (+ = will be auto installed as a result of dependency)
----------------------------------------------------
g++-3.3
+binutils
+cpp-3.3
+gcc-3.3
+libc6-dev
+libstdc++5.3.3-dev (may want 6)
+linux-headers

libasound2-dev

libglu1-mesa-dev
+libgl1-mesa-dev
+libx11-dev

x11proto-core-dev
x11proto-gl-dev
x11proto-kb-dev

libxxf86vm-dev
+x11proto-xf86vidmode-dev