Qbasicnews.com

Full Version: QBGFX not compiling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I am trying to compile one of the sample programs included in the library but it does not compile. Here is the error:

Code:
C:\FREEBA~1>fbc primitivesTest32.bas -s gui -i .\ QB_gfx_main.o QB_gfx_text.o QB_gfx_pal.o -l sdl

gfxmain.bi(87) : Error 25: Expected identifier, found: 'screen'

Yes, I included qbgfx4fb.bi and sdl.bi in the program. And line 87 in gfxmain.bi is:

Code:
declare function screen stdcall alias "fb_GfxScreen" (ScreenNum as integer) as integer

Why won't it compile?
Because FreeBASIC now has that library built in. There's no need to include qbgfx4fb.bi anymore, you can now use screen, pset, etc just like in QB.

Example
Code:
screen 256, 256, 32

for red = 0 to 255
   for green = 0 to 255
      pset (red, green), rgb(red, green, 255 - red)
   next green
next red

flip
do: sleep 50: loop until len(inkey$)