18b programs not compiling with Version 0.20.0 Beta

General FreeBASIC programming questions.
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

18b programs not compiling with Version 0.20.0 Beta

Postby relsoft » Sep 23, 2008 14:44

Code: Select all

Build error(s)
C:\programming\FreeBASIC\fbc -g "FbTemp.bas" "Tvector.bas" "Tmatrix.bas" "Tscreen.bas" "Tmodel.bas" "Tspline.bas"
C:/programming/FreeBASIC/inc/freeimage.bi(39) error 4: Duplicated definition, FALSE in '#define FALSE 0'
C:/programming/FreeBASIC/inc/freeimage.bi(40) error 4: Duplicated definition, TRUE in '#define TRUE 1'


Looking at the changelog:

Code: Select all

- update FreeImage header to v3.10 and .def files for Win32 (cha0s)


All my headers has this for TRUE/FALSE declarations:

Code: Select all

#ifndef FALSE
const as integer FALSE = 0
const as integer TRUE = not FALSE
#endif


How do I get my programs to compile in Version 0.20.0 Beta?

Thanks!
jofers
Posts: 1525
Joined: May 27, 2005 17:18
Contact:

Postby jofers » Sep 23, 2008 14:49

Yeah, those are really common symbols that every library thinks they own.

For a temporary fix, try putting

Code: Select all

#undef TRUE
#undef FALSE


before you include the FreeImage header.

PS: Oh, and for the code you posted, you might run into problems. If TRUE is already defined by a C library, it's likely to be 1, not "Not FALSE".
counting_pine
Site Admin
Posts: 6220
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Postby counting_pine » Sep 23, 2008 15:34

I think that problem has been fixed in the latest (SVN) version of the header, and some #ifndef's have been added around the #defines.
You can get the latest SVN version here:
http://fbc.svn.sourceforge.net/viewvc/f ... eeImage.bi
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Postby relsoft » Sep 24, 2008 1:04

Counting Pine:

Thanks!

I used the new header you posted and the program compiled w/o errors. However, The exe ran with this error:

Code: Select all

The procedure entry point FreeImage_ConvertTo32Bits could not be located in the dynamic link library FreeImage.dll


Isn't Freeimage.dll packaged with the windows build of the FB installer?

[edit]

I have just downloaded the latest FreeImage.DLL off sourceforge and it still reports the same error.

[SOLVED]
It's a borked .a file. anonymous1337 helped me with this one.

Return to “General”

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests