Bug in fbgfx.bi causing compiler error

General FreeBASIC programming questions.
Post Reply
lassar
Posts: 306
Joined: Jan 17, 2006 1:35

Bug in fbgfx.bi causing compiler error

Post by lassar »

When trying to get the jpeg library, I found a bug in fbgfx.bi

I narrowed down the code in the jpeg example causing this error.

Code: Select all

#LANG "fblite"

#include "fbgfx.bi"

declare function imageread_jpg( byval filename as zstring ptr, _
                                byval bpp as integer ) as FB.IMAGE ptr

Here is the error code, that I get.

F:\F Drive\Programs\Compilers Windows\Freebasic 24.0\examples\files\jpeglib\jpeptest.bas(6) error 14: Expected
identifier, found 'FB.IMAGE' byval bpp as integer ) as FB.IMAGE ptr
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Bug in fbgfx.bi causing compiler error

Post by fxm »

Look at fbgfx.bi:

Code: Select all

.....
# if __FB_LANG__ = "fb"
namespace FB
# endif
.....
# if __FB_LANG__ = "fb"
end namespace
# endif
If lang is not "fb", there is no namespace defined in fbgfx.bi.
Then you must use:

Code: Select all

#LANG "fblite"

#include "fbgfx.bi"

declare function imageread_jpg( byval filename as zstring ptr, _
                                byval bpp as integer ) as IMAGE ptr
                                
lassar
Posts: 306
Joined: Jan 17, 2006 1:35

Re: Bug in fbgfx.bi causing compiler error

Post by lassar »

Thanks for helping me for the above code.

I got the jpeg example to compile in fblite.

No luck on getting it, to actually work.

It crashes on me.
Post Reply