Linker errors

Just starting out? Need help? Post your questions and find answers here.
tomijan
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 1:32 pm

Linker errors

Post by tomijan »

Hi all,
after compiling my old program (compiled ok in PB v.4.40) I have error in linker :

POLINK: error: Unresolved external symbol 'SYS_FreeArray'
POLINK: error: Unresolved external symbol 'SYS_AllocateMultiArray'
POLINK: fatal error: 2 unresolved external(s)

Both function are in SystemBase.lib in version 4.40, but in v.4.50 are missing (only visible in compiler.exe)
Any suggestion?
thanks in advance
tom
registered user
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Linker errors

Post by c4s »

Do you use some userlibraries?
They often need to be recompiled by the creator to work on newer versions of PureBasic.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
tomijan
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 1:32 pm

Re: Linker errors

Post by tomijan »

Many thanks,
yes, some Gnozal's libraries should be updated

best regards
tom
registered user
tomijan
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 1:32 pm

Re: Linker errors

Post by tomijan »

Hi,
after updating Gnozal's libraries I got the same errors :cry:
tom
registered user
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Linker errors

Post by c4s »

If you are using unicode or threadsafe you have to change the subsystem for the userlibraries as well. Go to "Compiler" -> "Options" -> "Subsystem" and type in "UserlibUnicodeThreadsafe" for example.

Otherwise I can't help you. ;)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
tomijan
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 1:32 pm

Re: Linker errors

Post by tomijan »

Hi,
Error Unresolved external symbol 'SYS_FreeArray' is generated by following procedure:

Code: Select all

Procedure ParamsWrapper(params.s, type)
Protected txt.s, i, j=-1
Dim value.f(2)
txt.s = params.s
  While Len(txt.s)>0
    For i = 0 To 2
    txt.s = Left(params,FindString(params,",",1)-1)
    If Len(txt.s)=0
      value(i)  = ValF(params.s)
    Else
      params = Trim(Mid(params,Len(txt.s)+2,Len(params)))
      value(i)  = ValF(txt.s)
    EndIf
    Next
      Select type
         Case  #Equalizer
              If j<0
                Presets()\EQualizerOn = value(0)
              Else
                Presets()\EQPreset\fCenter[j]=value(0)
                Presets()\EQPreset\fBandwith[j]=value(1)
                Presets()\EQPreset\fGain[j]=value(2)
              EndIf
         Case  #Compressor
              If j<0
                Presets()\CompressorOn = value(0)
                Presets()\CompressorAuto = value(1)
              Else
                Presets()\ComprPreset\fGain=value(0)
                Presets()\ComprPreset\fThreshold=value(1)
                Presets()\ComprPreset\fRatio=value(2)
              EndIf
      EndSelect
    j+1
  Wend
EndProcedure
In assembled source generated by PBCompiler function "SYS_FreeArray" is used (only once in all program) in following context in above procedure:

Code: Select all

;
  ....
  Wend
  JMP   _While3589
_Wend3589:
; EndProcedure
  XOR    eax,eax
_EndProcedure563:
  PUSH   dword [esp]
  CALL  _SYS_FreeString@4
  PUSH   dword [esp+4]
  CALL  _SYS_FreeString@4
  PUSH   eax
  PUSH   dword [esp+20]
  CALL  _SYS_FreeArray@4       !!!!!!!!
  POP    eax
  ADD    esp,24
  POP    ebx
  POP    ebp
  RET    8
}
I suppose that error is generated by freeing array declared as local in line : Dim value.f(2)

Function 'SYS_AllocateMultiArray' never occurs in assembler source, but generate POLINK error. Strange.

Any suggestions?
thanks
tom
registered user
Fred
Administrator
Administrator
Posts: 18352
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Linker errors

Post by Fred »

I tested this code on 4.50 and it seems work:

Code: Select all

Procedure ParamsWrapper(params.s, type)
Protected txt.s, i, j=-1
Dim value.f(2)
txt.s = params.s
  While Len(txt.s)>0
    For i = 0 To 2
    txt.s = Left(params,FindString(params,",",1)-1)
    If Len(txt.s)=0
      value(i)  = ValF(params.s)
    Else
      params = Trim(Mid(params,Len(txt.s)+2,Len(params)))
      value(i)  = ValF(txt.s)
    EndIf
    Next
      Select type
         Case  0
              If j<0
                ;Presets()\EQualizerOn = value(0)
              Else
                ;Presets()\EQPreset\fCenter[j]=value(0)
                ;Presets()\EQPreset\fBandwith[j]=value(1)
                ;Presets()\EQPreset\fGain[j]=value(2)
              EndIf
         Case  1
              If j<0
                ;Presets()\CompressorOn = value(0)
                ;Presets()\CompressorAuto = value(1)
              Else
                ;Presets()\ComprPreset\fGain=value(0)
                ;Presets()\ComprPreset\fThreshold=value(1)
                ;Presets()\ComprPreset\fRatio=value(2)
              EndIf
      EndSelect
    j+1
  Wend
EndProcedure
ParamsWrapper(params.s, type)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Linker errors

Post by Trond »

Either you still have some old userlibs, or you have to reinstall PB. Maybe not all files got updated correctly.
Post Reply