Page 1 of 1

SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Posted: Wed Jan 12, 2011 8:05 am
by nco2k
any chance to fix this?

Code: Select all

Procedure Depth()
  !EXTRN _PB_Screen_Depth
  !MOV eax, [_PB_Screen_Depth]
  ProcedureReturn
EndProcedure

Procedure Screen()
  OpenScreen(640, 480, 16, "")
EndProcedure
---------------------------
TailBite Error
---------------------------
FAsm: Shared\Depth.asm

Error

Line no: 14

Error code: -127

Error String: SYMBOL_ALREADY_DEFINED
---------------------------
OK
---------------------------
c ya,
nco2k

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Posted: Wed Jan 12, 2011 11:29 am
by lexvictory
have you tried this?

Code: Select all

Import ""
_PB_Screen_Depth
EndImport
Import works for variables too (and TB should be able to handle it)

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Posted: Wed Jan 12, 2011 11:39 am
by nco2k
same error. :(

c ya,
nco2k

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Posted: Thu Jan 13, 2011 1:16 am
by lexvictory
this code works (and is easier to port to x64 as there's no need for change [unsure if this symbol has the same name in x64]):

Code: Select all

Import ""
PB_Screen_Depth
EndImport

Procedure Depth()
  ProcedureReturn PB_Screen_Depth
EndProcedure

Procedure Screen()
  OpenScreen(640, 480, 16, "")
EndProcedure
Though I will take a look into the extrn issue; but if you prefer the ASM way, just comment out the !extrn line; TB can figure out that its an external symbol by itself.

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Posted: Sat Jan 15, 2011 12:00 am
by nco2k
thanks, i always forget that _ is only the decoration. :)

c ya,
nco2k