[Done]Problem with static and PB 520 beta 5/6

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

mpz
Enthusiast
Enthusiast
Posts: 416
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

[Done]Problem with static and PB 520 beta 5/6

Post by mpz »

Hello,

i found a problem with the function static and PB 5.20 Windows. In the procedure the static variabe is not set to "extrn". I hope you find a solution:

Code: Select all

ProcedureDLL  Mytest (Var)
  
  Static *pointer
  
  If Not *pointer 
    *pointer = 10
  EndIf
  ProcedureReturn var + *pointer
EndProcedure


error undefinite_symbol

as code

Code: Select all

format MS COFF

Public PB_Mytest

section '.text' code readable executable

PB_Mytest:
PUSH   ebx
PS0=8
;
; Static *pointer
;
; If Not *pointer
CMP    dword [so_Mytest.p_pointer],0  <- error

it is missing

Code: Select all

extrn so_Mytest.p_pointer


i hope this helps to solve the problem...

Greeting Michael
Last edited by mpz on Thu Jul 18, 2013 8:38 pm, edited 3 times in total.
Working on - MP3D Library -
User avatar
Bisonte
Addict
Addict
Posts: 1159
Joined: Tue Oct 09, 2007 2:15 am

Re: Problem with static and PB 520 beta 5

Post by Bisonte »

The helpfile of tailbite :
Note on using STATIC keyword : The static keyword is not supported by tailbite. (The generated PureBasicStart routine is not evaluated.)
Please use a Global variable instead and initialize it in the Init function.
PureBasic 5.72 LTS (Windows x86/x64) | Windows10 Pro x64 | Z370 Extreme4 | i7 8770k | 64GB RAM | iChill GeForce RTX 2080 Super | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)
mpz
Enthusiast
Enthusiast
Posts: 416
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: Problem with static and PB 520 beta 5

Post by mpz »

Hi Bisonte,

i use static since 3 years with tailbite and PB and it woks fine. I think it is only a little think for changing. If it is not possible i will test it with global...

Greetings Michael
Working on - MP3D Library -
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Problem with static and PB 520 beta 5

Post by ABBKlaus »

Know issues wrote:- The use of the Static keyword is limited to basic types : Byte,Word,Long,Integer,Quad,Double
You can´t use Strings / Dim() as they allocate memory in a different place of code that TailBite is not parsing
It was totally legal until PB5.20 came out :twisted:

I´ll try to fix it :shock:
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Problem with static and PB 520 beta 5

Post by ABBKlaus »

I found out that static objects got renamed to "so_" in older Versions it was "s_". I added it to the List of VarAliases in TailBite_Res.pb.

It might not be the last Change to be found.

Here´s the download : http://www.tailbite.com/downloads/TailBiteV1.4.10.zip

BR Klaus
mpz
Enthusiast
Enthusiast
Posts: 416
Joined: Sat Oct 11, 2008 9:07 pm
Location: Germany, Berlin > member German forum

Re: Problem with static and PB 520 beta 5

Post by mpz »

Hello ABBKlaus,

i tested it with Windows XP, my (monster) code and PB 5.20 Beta 5 and it works fine. Tomorrow i will test it with Windows 7 and PB 5.2 x86 and x64...

*P.S.: tested with Windows 7 x86 and x64, works fine

Much thanks
Michael
Working on - MP3D Library -
Post Reply