Qbasicnews.com

Full Version: Linker problems -- HELP!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been trying to compile some code I found posted here to open a screen and put dots on it using SDL, but it keeps giving me C:\freeBASIC\hello.o(.text+0x135):fake: undefined reference to `SDL_UnLockSurface' whenever I try to compile it!

This is KILLING me! I've got code to port!!! Please, help!


Code:
defint a-z
option explicit

'$include: "sdl\sdl.bi"
'$include: "gl\gl.bi"
'$include: "gl\glu.bi

declare sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)

dim screen as SDL_Surface ptr
dim a as string
Dim X as integer
Dim Y as integer
Dim T as UBYTE
screen = SDL_SetVideoMode( 640, 480, 32, SDL_HWSURFACE or SDL_DOUBLEBUF)
if screen = 0 then
SDL_Quit
end 1
end if



do
a = inkey$
if a = chr$(27) then exit do
SDL_LockSurface (screen)

For X = 1 to 100
for Y = 1 to 100
Pset screen ,X,Y,23+X,43+Y,X,255 ' <-- add +X +Y anywhere in
next ' the parmitor list or even
next ' a +10 or somthing

SDL_unlocksurface screen
SDL_Flip screen
loop

SDL_Quit
end


sub PSET (screen as SDL_Surface ptr , x as integer , y as integer, R as UBYTE , G as UBYTE, B as UBYTE, A as UBYTE)
dim cl as uinteger ptr
dim colkey as uinteger
dim Colptr as UBYTE ptr

colptr = @colkey : *colptr = R
colptr = @colkey + 1 : *colptr = G
colptr = @colkey + 2 : *colptr = B
colptr = @colkey + 3 : *colptr = A
cl = screen->pixels + y * screen->pitch + x * len( integer )
*cl = colkey
end sub
http://forum.qbasicnews.com/viewtopic.php?t=7424

Quote:You must correct the Unlock declaration (the alias is currently as "SDL_UnLockSurface") to compile that example, it should be:
Code:
declare sub            SDL_UnlockSurface cdecl  alias "SDL_UnlockSurface" (byval surface as SDL_Surface ptr )


EDIT: V1c, how about the next patch including the corrected header?
Yeah, thx for posting that.

Will include the new sdl header when i rls the next version, will try to include the winsock one too.. multiplayer games using threads, lets see how easy they can be..
V1c, I'm not sure if I've mentioned this yet, but you're my new god.

You've managed to create a BASIC complier which doesn't

- wish it was C
- nerf the language with a slow/shitty compiler
- do wierd things that make it incompatible with everything
- suck

This really is the start of a new era...

If you ever need a few bucks to keep things moving, don't hesitate to ask; I'm sure even MY below poverty line ass can scrounge a few bucks together in return for a new era. Smile
Thx ;) But you forgot to list:

- is buggy as hell at the moment 'cause v1ctor was a lazy ass and didn't test enough


Time may help, at least i'm trying to fix all bugs found as fast as i can, but..


Some pizzas would be great, order me a beer or two also ;)
sorry for that sdl header mistakes, i really apologize for that, i'm stupid hit me
this is better, cuz all of us can find bugs faster than you could. Then you can spend time fixing them instead of finding them. Smile
With enough eyes, all bugs are shallow. Smile
I think it's a good move to release it.

Like said, easier to find and fix the bugs... plus, I get to play with it =)





And I really like it, I have 0, nul, zero, none, diddly squat, knowlegde of windows programming, or API's or pointers etc etc etc.. basically, all I know is QB...

Yet, I feel right at home with freeBASIC, really good job Big Grin
Yeah, I'm not sure if V1c is following a standard defined elsewhere, but the new additions are EXACTLY how I envisioned an advanced BASIC: You don't need to care about pointers or other advanced features unless you want to, but you're also not limited to some crippled subset of hand-coded basic commands.

compiler + someone elses libs. It's the dream. Smile
Pages: 1 2