Using "Framework" correctly

BlitzMax Forums/BlitzMax Programming/Using "Framework" correctly

DavidDC(Posted 2007) [#1]
My MaxGui app compiles and runs fine in debug mode with "Framework BRL.MaxGui"in the main.bmx file header.

If I delete .bmx folder turn off quick build and debug build to build in release mode the app compiles with no errors. Only it fails on init when trying to invoke:

LoadImage(s_filename)

Note the code hasn't changed at all from the debug version so the file paths etc should be fine. I tried Importing BRL.Max2d in the texture loader (where LoadImage) lives, but the error still occurs.

If I comment out Framework BRL.MaxGui in the main.bmx file and build in release mode the app compiles and runs correctly.

Which leaves me scratching my head and looking vacantly about for answers. Suggestions anyone?

Thanks!

David

Max 1.26, OS X 10.4.1 Intel.


TaskMaster(Posted 2007) [#2]
Without any FrameWork commands, then they all get compiled in.

My guess, since your error is in the LoadImage command, you need the framework for jpg images (or whatever format your image is).


DavidDC(Posted 2007) [#3]
Importing BRL.PNGLoader does get me past the LoadImage calls. But the app now crashes on CreateWindow.

I added all sorts of other Imports (basically any that looked remotely likely to be needed) to no avail. So I think I'm going to call too-hard-basket on this one for the time being and live with that extra meg of bloat for a while.

Thanks for the help though!

d


Gabriel(Posted 2007) [#4]
CreateWindow is a MaxGUI function, so you need to import brl.maxgui *and* the MaxGUI implementation which matches your OS. ( eg: brl.win32maxgui if you're on Windows. )


TaskMaster(Posted 2007) [#5]
There is an app around here called Framework Assistant that looks at your code and lists the frameworks you need. If you search, I am sure you can find the download link.


DavidDC(Posted 2007) [#6]
Thanks very much for all the help. I finally did get it running, although it was via a great deal of trial and error, crashing and no compiler/linker warnings - which seemed odd at the time!

I guess the moral of the story is to use Framework from the outset, rather than plonking it into a large project near the end. And if there's any helper apps out there like Framework Assistant out there - go for them, as otherwise you may end up muddling about in the dark like I did :)


H&K(Posted 2007) [#7]
http://homepage.ntlworld.com/config/fa/fa.zip

Use It