How do you compile your project w/ freeimage lib?

BlitzMax Forums/BlitzMax Beginners Area/How do you compile your project w/ freeimage lib?

Guy Fawkes(Posted 2009) [#1]
As it says above, how EXACTLY, STEP-BY-STEP, can I compile my project to work w/ freeimage library? I get a compile error w/ the project..



ANY help is GREATLY appreciated! :)

~DS~


Guy Fawkes(Posted 2009) [#2]
I get:




REDi(Posted 2009) [#3]
You should import it like any other module...
Import BaH.FreeImage

Why do you have three threads for one topic?

*EDIT* If you look in the module source you should see a folder called "tests", have a look at the source code in there to see how to use the module.


Brucey(Posted 2009) [#4]
Why do you have three threads for one topic?

Because he's new to BlitzMax? :-)

I get:

I'll assume you've never installed a module for BlitzMax before (going by the error message you've kindly provided)?

Interestingly, if you were to read degac's reply to your question in this post he explains very well all the steps you need to complete in order to get it working.

You may also find that you'll need to install MinGW. It's a developer tool for Windows.


Guy Fawkes(Posted 2009) [#5]
i tried Import BRL.FreeImage.

didnt work ><


Brucey(Posted 2009) [#6]
Try running one of the included "tests". They are located in the tests folder.

If you've set everything up correctly, and the modules have been built, all the tests should work.


Guy Fawkes(Posted 2009) [#7]
"Can't find BaH.FreeImage"


Brucey(Posted 2009) [#8]
What number did you get to here?


Guy Fawkes(Posted 2009) [#9]
sorry for the double post. tired..

i got to the part where u put the files in blitzmax/mod/freeimage.mod/


CASO(Posted 2009) [#10]
You need to put the files another level deeper.
ex. "blitzmax/mod/bah.mod/freeimage.mod/"


Guy Fawkes(Posted 2009) [#11]
still getting

can't find interface for module BaH.FreeImage.


degac(Posted 2009) [#12]
Ok, can you post an image / type here HOW is structured your MOD folder under blitmax?
What OS are you running?
Do you have installed MinGW (in case of Windows OS)?
Do you have REBUILDED the modules after copying it? (in MaxIDE press CTRL+D or from the menu Programs -> Build Modules)

The error

can't find interface for module BaH.FreeImage.


is due to bad copy/installation.


Guy Fawkes(Posted 2009) [#13]
i'm not gonna lie.

its blitzmax demo version..

here's the pic:



Inside of the mod folder is freeimage.mod/

and inside that folder is the files to freeimage library.


Brucey(Posted 2009) [#14]
its blitzmax demo version..


Can't help you there then. Sorry.


Guy Fawkes(Posted 2009) [#15]
why not? What's the dang difference? lol


Brucey(Posted 2009) [#16]
Well, for starters, I can't be expected to support modules running on the demo version of BlitzMax.

For all I know, you can't even build modules on the demo version - which could be a problem if you ever need to build the modules.

I can certainly provide you with an example app displaying an anim gif, if you like? Then you'll know whether it works or not.

Then you can determine whether you should consider purchasing a license for BlitzMax :-)


Guy Fawkes(Posted 2009) [#17]
sure! :) that would be great! :)


Guy Fawkes(Posted 2009) [#18]
Ok, I asked my friend to try freeimage, and he has the fullversion. and he said that hes still getting the same error that im getting.


Brucey(Posted 2009) [#19]
I've uploaded a small demo here. (980kb / 1.34/win32/cross-compiled on Mac)

This is the source for the app :
' TEST 6
'
' Load and display an animated gif - loading all frames into a TImage

SuperStrict


Framework BaH.FreeImage
Import brl.glmax2d

Graphics 800,600,0

' load the animated image
Local image:TImage = LoadAnimFreeImage("anim.gif")
If Not image Then
	DebugLog("Couldn't load...")
	End
End If

Local count:Int = image.frames.length
Local pos:Int = -1


While Not KeyDown(key_escape)

	pos:+ 1
	
	If pos = count Then
		pos = 0
	End If

	Cls
	
	DrawImage image, 400 - ImageWidth(image)/2, 300 - ImageHeight(image)/2, pos

	Flip
	
Wend

End

So, you can swap out the file anim.gif to try other images - should work.


 he said that hes still getting the same error that im getting

The module will need to be compiled. I used to ship pre-compiled modules, but the logistics these days are a bit bigger than me (40+ modules * 4 platforms).
To compile modules you need to install MinGW. Then you need to "build modules".
Assuming you've installed it into the correct folder, the module should be compiled when you "build modules".

Until the module is compiled, (this applies for all modules - the official ones are of course pre-compiled), you are going to see this kind of error "can't find interface for module BaH.FreeImage".