SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Post 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
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Post 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)
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Post by nco2k »

same error. :(

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Post 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.
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: SYMBOL_ALREADY_DEFINED - !EXTRN _PB_Screen_Depth

Post by nco2k »

thanks, i always forget that _ is only the decoration. :)

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Post Reply