Some code to load any image to a FB image (using FreeImage)

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
Pottersson
Posts: 25
Joined: Jun 13, 2008 17:10

Still not working...

Post by Pottersson »

I followed the above code word-for-word (literally, I just changed the filename and tried to compile). I received the following error:

Code: Select all

F:\PortableApps\FbEdit\FreeBASIC\fbc -s gui "FbTemp.bas"
FbTemp.o:fake:(.text+0x259): undefined reference to `FreeImage_ColorQuantizeEx@20'

Build error(s)
This is the same error as was posted previously by several people, including Tafoid.

I then tried to switch out my libFreeImage.dll.a for cha0s' and got the newest FreeImage.bi. I still get the error.

I'm running FB 0.18.5 and have very little experience using external libraries. I just need a way to display PNG files using the built-in fbgfx routines. If I thought I could, I'd just write my own PNG loading routine from scratch. But as it is, it would be better if I can use a library.

I also tried using MichaelW's solution of rebuilding the import library, but I still get an error:

Code: Select all

F:\PortableApps\FbEdit\FreeBASIC>bin\win32\dlltool -k -d freeimage.dll.def -l libfreeimage.dll.a
<!bin\win32\dlltool: Syntax error in def file freeimage.dll.def:4
Any help would be greatly appreciated.
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

Try the link again: http://therealcha0s.net/project/libfreeimage.dll.a

I think when I was testing, I had the dll in the compilation directory, so it was using that. I updated the import lib with the latest .def in SVN, and it compiles fine here at least. Please lemme know how it works out for you.
Last edited by cha0s on Jul 20, 2008 21:54, edited 1 time in total.
Pottersson
Posts: 25
Joined: Jun 13, 2008 17:10

Post by Pottersson »

Now I'm getting 404'd. "Cannot find server" it says.
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

ARG XD. It should be all fixed up now.
Pottersson
Posts: 25
Joined: Jun 13, 2008 17:10

Post by Pottersson »

Compiles fine now, thanks for the quick response.

Now I get this dialog box: "The procedure entry point FreeImage_ColorQuantizeex could not be located in the dynamic link library FreeImage.dll"

I just downloaded the newest dll from SourceForge, 3.10. I looked at my header, and it has the same version.
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

I dunno. Maybe it has to do with the order Windows is searching for dll's in the path settings. Try moving/deleting the freeimage.dll that you see, and see if you get the same error. If so, there's another version of the dll laying around on your system which is causing it.

Beyond that, not too sure. I know for a fact that symbol is in the library.
DrV
Site Admin
Posts: 2116
Joined: May 27, 2005 18:39
Location: Midwestern USA
Contact:

Post by DrV »

Is that the actual case ("ex" vs "Ex") ?
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

DrV wrote:Is that the actual case ("ex" vs "Ex") ?
I thought so too when I saw it, but I checked the .def and unless some act of God happened, it's 'Ex'
Pottersson
Posts: 25
Joined: Jun 13, 2008 17:10

Post by Pottersson »

I dunno. Maybe it has to do with the order Windows is searching for dll's in the path settings. Try moving/deleting the freeimage.dll that you see, and see if you get the same error. If so, there's another version of the dll laying around on your system which is causing it.

Beyond that, not too sure. I know for a fact that symbol is in the library.
Okay. I temporarily took the dll out of the folder the program was in, and tried to run the program. Windows complained that it couldn't find FreeImage.dll, so I know that there isn't an old duplicate sitting in the system folders.

I did a text search for "ColorQuantizeEx" in my FreeImage header, dll.a file, and my dll. The function turned up in all three files, but I have a question: are the entries in the dll supposed to have an underscore in front of them? Below is the only place in the dll I found "ColorQuantizeEx"

Code: Select all

_FreeImage_CloseMultiBitmap@8 _FreeImage_ColorQuantize@8 _FreeImage_ColorQuantizeEx@20 _FreeImage_Composite@16
I also tried to run the program on a different computer, and I still got the same error message. Has anyone gotten FreeImage to work?
cha0s
Site Admin
Posts: 5319
Joined: May 27, 2005 6:42
Location: USA
Contact:

Post by cha0s »

The underscores are normal.
Cherry
Posts: 358
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Post by Cherry »

After I have installed FreeBASIC 0.20.0b, my program isn't working anymore. I get the message "The procedure entry point "FreeImage_Allocate" in FreeImage.dll isnt found".

FreeImage.dll is located in my program's directory and in the system directory.

Could somebody PLEASE give me his .def and .a file?!
Cherry
Posts: 358
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Post by Cherry »

I finally managed it by myself - here you have working .def and .a-files for FreeImage 3.11.0:

http://cherrytree.at/misc/FreeImage.dll.def
http://cherrytree.at/misc/libfreeimage.dll.a

mfG Cherry
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Post by anonymous1337 »

Anyone here have conversion from fbgfx back to freeimage?
LukeL
Posts: 118
Joined: Mar 14, 2006 17:26

Post by LukeL »

Check this out for fbgfx to freeimage... http://www.freebasic.net/forum/viewtopic.php?p=107994
There should be enough code there to get a FreeImage buffer with modification.
Keal
Posts: 5
Joined: May 11, 2009 10:38

Where to get FreeImage.dll

Post by Keal »

Post Reply