Can't find interface for module 'brl.maxgui'

BlitzMax Forums/Brucey's Modules/Can't find interface for module 'brl.maxgui'

markcw(Posted 2014) [#1]
Running Bmax 1.48 linux trying to get gtkmaxgui.mod/tests building. Is it not maxgui.maxgui?


Brucey(Posted 2014) [#2]
Welcome back!
Some of the tests may not have been re-factored to reflect the changes in MaxGUI's location.


markcw(Posted 2014) [#3]
Thanks.
I will have a closer look then... I seem to have forgotten a lot.


markcw(Posted 2014) [#4]
Well I edited gtkcommon.bmx to
Import maxgui.maxgui 'Import BRL.MaxGUI


And then rebuilt bah.gtkmaxgui getting
Compile Error: Unable to create new object of abstract type 'TGuiFont' due to abstract method 'CharWidth'
[/home/mark/BlitzMax148/mod/bah.mod/gtkmaxgui.mod/gtkcommon.bmx;594;2]


So I found this similar error http://www.blitzmax.com/Community/posts.php?topic=89293
which suggests to unabstract the method so I did that in maxgui.mod/guifont.bmx rebuilt mods and got a similar error
Compile Error: Unable to create new object of abstract type 'TGTKGUIDriver' due to abstract method 'UserName'
[/home/mark/BlitzMax148/mod/bah.mod/gtkmaxgui.mod/gtkgui.bmx;7;1]


So I unabstracted that too in maxgui.mod/driver.bmx rebuilt mods then got
Compile Error: Unable to create new object of abstract type 'TGTKGUIDriver' due to abstract method 'ComputerName'
[/home/mark/BlitzMax148/mod/bah.mod/gtkmaxgui.mod/gtkgui.bmx;7;1]


Unabstracted that, rebuilt mods and now no errors but when I run something in gtkmaxgui.mod/tests I get
Compile Error: Identifier 'WaitEvent' not found


Brucey(Posted 2014) [#5]
Hold on, where are you getting your source from?

The source in SVN or the GitHub mirror should work fine without any changes.

I'm currently using that source to build my MaxIDE on Linux, which is an order of magnitude superior to the fltk MaxIDE that ships with BlitzMax. It also has a drop-in replacement TextArea gadget which uses Scintilla, just to make the experience even better.
I actually prefer using the Linux MaxIDE to my OS X MaxIDE - how times have changed...


Brucey(Posted 2014) [#6]
And there's this.


Brucey(Posted 2014) [#7]
Oh, and I *highly* recommend you also use my updated BRL and PUB modules or you *will* have issues if you decide to use any of the BlitzMax Image loaders and GTK. (i.e. segfaults/crash/mav)


markcw(Posted 2014) [#8]
dodgy post.


markcw(Posted 2014) [#9]
dodgy post.


markcw(Posted 2014) [#10]
Thanks.

I was using the old gtkmaxgui.zip from your site because I couldn't find the latest download on google code and it didn't occur to me that I had to checkout ALL the modules with svn.
I have svned now plus github downloads for good measure and am using your brl and pub mods.

I have tried building all bah modules and 41 gave errors [SOLVED - see post below]. I thought I should list them for the benefit of anyone struggling to build bah (or even perhaps Brucey). I also realized that rebuilding bah just to avoid typing the mod name wastes much time. And I took off the .mod from the folders so I knew what doesn't work (which wasn't a good idea - for Brucey's mods just makemods one at a time).

barcode boostlocale
datetime
gdal
libcurlssl libiconv

Also I noticed that latest maxgui 1.42 beta doesn't makemods with Brucey's brl and pub mods but maxgui included in bmax 1.48 worked. I think the error was...
/home/mark/BlitzMax/mod/maxgui.mod/fltkmaxgui.mod/src/Fl_PNG_Image.cxx: In constructor ‘Fl_PNG_Image::Fl_PNG_Image(const char*)’:
/home/mark/BlitzMax/mod/maxgui.mod/fltkmaxgui.mod/src/Fl_PNG_Image.cxx:81: error: invalid use of incomplete type ‘struct png_struct_def’
/home/mark/BlitzMax/mod/pub.mod/libpng.mod/png.h:552: error: forward declaration of ‘struct png_struct_def’
...etc
Build Error: failed to compile /home/mark/BlitzMax/mod/maxgui.mod/fltkmaxgui.mod/src/Fl_PNG_Image.cxx


So I guess this is mostly due to a lack of dependencies, or maybe I am outdated on this ubuntu 10 lucid (32-bit) distro even though I am up-to-date with it.
I have solved some issues but still not got gtkmaxgui working. I checked out dependencies for gtk+2 here http://www.gtk.org/download/win32.php
and I had these but installed debug stuff just in case

libatk1.0-dbg libcairo2-dbg libfontconfig1-dbg libglib2.0-0-dbg libpango1.0-0-dbg zlib1g-dbg

But still I got this error
Compiling:events.c
In file included from /usr/include/gtk-2.0/gdk/gdkscreen.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:31,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /home/mark/BlitzMax/mod/bah.mod/gtkmaxgui.mod/events.c:24:
/usr/include/gtk-2.0/gdk/gdktypes.h:55:23: error: gdkconfig.h: No such file or directory
Build Error: failed to compile /home/mark/BlitzMax/mod/bah.mod/gtkmaxgui.mod/events.c


So I found a nice wiki http://www.linuxintro.org/wiki/Error_messages_and_their_solutions
which says to simply find the file and copy it, but rather than that I symlinked it
cd /usr/lib
find -iname "gdkconfig*"
sudo ln -s /usr/lib/gtk-2.0/include/gdkconfig.h /usr/include


So this solved building gtkmaxgui but still it doesn't run gtkmaxgui.mod/tests with createwindow.bmx it says Compile Error: Identifier 'WaitEvent' not found
And with createbutton.bmx it has this
../BlitzMax/mod/bah.mod/gtkmaxgui.mod/gtkmaxgui.debug.linux.x86.a(gtkgadget.bmx.debug.linux.x86.o): In function `_bah_gtkmaxgui_TGTKScrollBar_initScrollBar':
(code+0x19826): undefined reference to `gtk_range_set_round_digits'
collect2: ld returned 1 exit status
Build Error: Failed to link /home/mark/BlitzMax/mod/bah.mod/gtkmaxgui.mod/tests/createbutton.debug


The other bah mods that I tried were usually working for example box2d, chipmunk, freeimage but others are not, like cairo. I am using gcc 4.4.3.

I have quite a lot of makemods errors which I am going to look at now and see if I can solve any. I did resolve one, speech.mod where the error was
Compiling:glue.cpp
/home/mark/BlitzMax/mod/bah.mod/speech.mod/glue.cpp:23:22: error: festival.h: No such file or directory

I googled: festival.h site:http://packages.ubuntu.com
and found it in festival-dev which installs: libestools1.2 libestools1.2-dev
but the speech.mod/example_01.bmx reports
Initialization file /usr/share/festival/init.scm not found
SIOD ERROR: unbound variable : SayText


So again (with gtk) I am stumped. Sorry if this is a headache...


markcw(Posted 2014) [#11]
Donated. Hope that was enough. :)


markcw(Posted 2014) [#12]
Well, I found out some mods depend on others mods which is why you get this sort of thing
Compiling:xlwriter.bmx
Compile Error: Can't find interface for module 'bah.libxml'
[/home/mark/BlitzMax/mod/bah.mod/xlwriter.mod/xlwriter.bmx;36;1]


So I removed these mods from my list above.

This list is in the format: Import > Module (or dependency > module importing it). There must be more dependencies than that but this is what I found. [Edit: updated to list all BaH Imports]

base64 > dbgp
bass > Bass_FX
bass > GMEBass
bass > SidBASS
bass > TheoraPlayerBASS
boost > BoostLocale
boost > FileSystemEX
boost > Interprocess
boost > Libtorrent
boost > Rational
boostlocale > DateTime
bigint > Barcode
cegui > CEGUIDirect3D9
cegui > CEGUIOpenGL
crypto > Libtorrent
database > DBMySQL
database > DBODBC
database > DBOracle
database > DBPostgreSQL
database > DBSQLite
database > DBXbase
expat > GDAL
expat > Graphviz
freeimage > CEGUI
fmod > FMODAudio
fmod > RaknetVoiceFMOD
gme > GMEBass
gme > GMEOpenAL
graphviz > GraphvizMax2D
gtkmaxgui > GTKWebGTKHTML
gtkmaxgui > GTKWebMozilla
gtkmaxgui > GTKWebKitGtk
gtkmaxgui > MaxGUITextAreaScintilla
irrklang > irrKlangAudio
leptonica > Tesseract
libiconv > Barcode
libiconv > BoostLocale
libiconv > LibArchive
libcurl > GDAL
libcurl > Raptor
libssh2 > libcurlSSL
libxml > LibArchive
libxml > Libxslt
libxml > Locale
libxml > Magick
libxml > Persistence
libxml > XLWriter
libxslt > Raptor
oggvorbis > TheoraPlayer
osmesa > OSMesaGraphics
osmesagraphics > OSMesaMax2D
osmesagraphicsbase > OSMesaGraphics
osmesagraphicsbase > OSMesaMax2DBase
osmesamax2dbase > OSMesaMax2D
raknet > RaknetRooms
raknet > RaknetVoice
raknetvoice > RaknetVoiceFMOD
raptor > Flickcurl
regex > CEGUI
regex > Format
regex > FTPParser
regex > Serial
regex > XLWriter
sid > SidBASS
sstream > LibArchive
sstream > RamSStream
sstream > TextSStream
streamhtmlparser > ClearSilver
theoraplayer > TheoraPlayerBASS
xz > LibArchive

Also magick needed a symlink
sudo ln -s /usr/include/sys/io.h /usr/include


And for extra packages

dbmysql < libmysqlclient-dev (mysql.h)
gtkwebkitgtk < libwebkitgtk-dev
gtkwebgtkhtml < libgtkhtml3.14-dev
libsmbclient < libsmbclient-dev (libsmbclient.h)
libusb < libusb-dev (usb.h)
oggvorbis < libogg-dev libvorbis-dev (config_types.h)
theoraplayeropenal < libopenal-dev (al.h)

Edit: also these are mods that I can't build but know the dependencies

barcode < libiconv
boostlocale < libiconv
datetime < boostlocale

The libiconv error is
Compiling:glue.cpp
/home/mark/BlitzMax/mod/bah.mod/libiconv.mod/glue.cpp: In function ‘size_t bmx_iconv(void*, const char**, size_t*, char**, size_t*)’:
/home/mark/BlitzMax/mod/bah.mod/libiconv.mod/glue.cpp:48: error: invalid conversion from ‘const char**’ to ‘char**’
/home/mark/BlitzMax/mod/bah.mod/libiconv.mod/glue.cpp:48: error:   initializing argument 2 of ‘size_t iconv(void*, char**, size_t*, char**, size_t*)’
Build Error: failed to compile /home/mark/BlitzMax/mod/bah.mod/libiconv.mod/glue.cpp


And the theoraplayer error is [SOLVED - see post below]
Compiling:TheoraVideoFrame.cpp
../BlitzMax/mod/bah.mod/theoraplayer.mod/libtheoraplayer/src/TheoraVideoFrame.cpp: In constructor ‘TheoraVideoFrame::TheoraVideoFrame(TheoraVideoClip*)’:
../BlitzMax/mod/bah.mod/theoraplayer.mod/libtheoraplayer/src/TheoraVideoFrame.cpp:80: error: ‘memset’ was not declared in this scope
../BlitzMax/mod/bah.mod/theoraplayer.mod/libtheoraplayer/src/TheoraVideoFrame.cpp: In member function ‘virtual void TheoraVideoFrame::decode(TheoraPixelTransform*)’:
../BlitzMax/mod/bah.mod/theoraplayer.mod/libtheoraplayer/src/TheoraVideoFrame.cpp:115: error: ‘memcpy’ was not declared in this scope
../BlitzMax/mod/bah.mod/theoraplayer.mod/libtheoraplayer/src/TheoraVideoFrame.cpp:123: error: ‘memcpy’ was not declared in this scope
Build Error: failed to compile ../BlitzMax/mod/bah.mod/theoraplayer.mod/libtheoraplayer/src/TheoraVideoFrame.cpp



Brucey(Posted 2014) [#13]
Hallo :-)

I'd just use the ones you were really interested in to begin with - the gtk stuff, rather than get distracted by "other" things.


@gtk_range_set_round_digits

The GTK docs say gtk_range_set_round_digits is "Since 2.24". Ideally, you want to use a most recent version of GTK if you can.
GaryV asked to port to GTK3, which is even newer - but is essentially a complete rewrite of the mod, and I don't have time for that at the moment.

@gdkconfig.h

Possibly I just need to add *another* -I location to support that dir. I thought I'd covered most of them, but apparently not so. (see the bottom of gtkmaxgui.bmx for details)

@'WaitEvent' not found
You now need to specify Import BRl.EventQueue if you are using Framework. Previously, MaxGUI imported this for you somewhere, but doesn't now. Of course, if you don't use Framework you get all of BRL and PUB compiled into your application for free.


markcw(Posted 2014) [#14]
Thank you.

That was what I had to do. I had gtk2 2.20 and in order to go to 2.24 I had to upgrade my distro to 12.4 precise. Now gtkmaxgui tests and wx samples build! :)

I removed my gdkconfig.h symlink and rebuilt gtkmaxgui and it was fine without it.

I also noticed oggvorbis now builds without error but the other mods still have errors that I can't resolve.

And another note: for Bmax 1.50, Maxide and bmk didn't run/execute in 10.4 but they work now in 12.4. No big deal, it was time to move on.

Thanks for the brl.eventqueue tip.

Good day.


markcw(Posted 2014) [#15]
I found the bug in theoraplayer. It was the memset/memcpy functions needed string.h
http://stackoverflow.com/questions/2505365/compiler-error-memset-was-not-declared-in-this-scope

I just put it on line 12 after the other includes...
libtheoraplayer/src/TheoraVideoFrame.cpp
#include "TheoraVideoClip.h"
#include "TheoraVideoFrame.h"
#include <string.h>

extern "C"
{


Also theoraplayeropenal just needed libopenal-dev
In file included from /home/mark/BlitzMax/mod/bah.mod/theoraplayeropenal.mod/audio_interface/src/OpenAL_AudioInterface.cpp:10:0:
/home/mark/BlitzMax/mod/bah.mod/theoraplayeropenal.mod/audio_interface/src/OpenAL_AudioInterface.h:21:19: fatal error: AL/al.h: No such file or directory