POLINK error with pcre & PB4.61
Posted: Wed May 23, 2012 2:49 pm
I'm sure I'm being a numpty and missing something obvious, I've checked a lot of search results but haven't seen a solution.
I've just compiled one of my projects with the new 4.61, (also b4 errors as well), and have this error crop up.
Now compiling with 4.60 worked, and I think (but can't be sure) that 4.61b3 worked as well.
this code below (an example from another topic) shows the problem.
Any help or suggestions on how to fix?
I've just compiled one of my projects with the new 4.61, (also b4 errors as well), and have this error crop up.
Code: Select all
POLINK: error: Unresolved external symbol '_pcre_exec'.
POLINK: fatal error: 1 unresolved external(s).
this code below (an example from another topic) shows the problem.
Any help or suggestions on how to fix?
Code: Select all
;{ LIB code
ImportC ""
pcre_exec(*pcre,*extra,subject.s,length,startoffset,options,*ovector,ovecsize)
EndImport
Structure List_Extraction
Array Extract.s(0)
EndStructure
Procedure.s BackrefReplaceRegularExpression(regexp_handle, string.s, replacement.s, maximum_reference.l = 10) ; 0 <= maximum_reference <= 99
Static Dim pcre_results.l(202)
depart = 0
Repeat
res.l = pcre_exec(PeekI(regexp_handle), 0, string, Len(string), depart, 0, @pcre_results(), 202)
If res > 0
rpl.s = replacement
p = pcre_results(0)
q = pcre_results(1)
If FindString(replacement,"$0", 1)
rpl = ReplaceString(rpl, "$0", PeekS(@string + p, q - p))
EndIf
tableau_ref = 2
For _a = 1 To maximum_reference
tag$ = "$" + Str(_a)
If FindString(replacement, tag$, 1)
p1 = pcre_results(tableau_ref)
q1 = pcre_results(tableau_ref + 1)
rpl = ReplaceString(rpl, tag$, PeekS(@string + p1, q1 - p1))
EndIf
tableau_ref + 2
Next
depart = p + Len(rpl)
string = Left(string, p) + rpl + Right(string, Len(string) - q)
EndIf
Until res = -1
ProcedureReturn string
EndProcedure
Procedure.s BackrefExtractRegularExpression(regexp_handle, string.s, Array Extract.b(1), List Resultat.List_Extraction()) ; 0 <= Taille tableau Extract <= 99
Static Dim pcre_results.l(202)
depart = 0
maximum_reference = ArraySize(Extract())
ClearList(Resultat())
Repeat
res.l = pcre_exec(PeekI(regexp_handle), 0, string, Len(string), depart, 0, @pcre_results(), 202)
If res > 0
; pcre_exec(PeekL(regexp_handle), 0, string, Len(string), pcre_results(1), 0, @pcre_results(), 202)
AddElement(Resultat())
Dim Resultat()\Extract(maximum_reference)
p = pcre_results(0)
q = pcre_results(1)
If Extract(0) = #True
Resultat()\Extract(0) = PeekS(@string + p, q - p)
EndIf
tableau_ref = 2
For _a = 1 To maximum_reference
If Extract(_a) = #True
p1 = pcre_results(tableau_ref)
q1 = pcre_results(tableau_ref + 1)
Resultat()\Extract(_a) = PeekS(@string + p1, q1 - p1)
EndIf
tableau_ref + 2
Next
depart = p ; + Len(rpl)
; string = Left(string, p) + rpl + Right(string, Len(string) - q)
string = Left(string, p) + Right(string, Len(string) - q)
EndIf
Until res =-1
ProcedureReturn string
EndProcedure
;}
REGEX$ = " t(.*?)e(.*?) "
CHAINE$ = "As they functions tried importing them through the tset "
; regular expression creation
rh = CreateRegularExpression(0, REGEX$)
Debug "#### Recurrent Replacement test :"
Debug ""
Debug "Starting text :"
Debug CHAINE$
Debug "Regex = ||" + REGEX$ + "||"
Debug ""
Debug "Result :"
Debug BackrefReplaceRegularExpression(rh, CHAINE$, "________$0")
; creation of the array specifying which parenthesis must be returned
Dim tableau_extraction.b(2)
; we want all parenthesis so we complete the array all the way
For a = 0 To 2
tableau_extraction(a) = #True
Next
; creation of the list returning the result
NewList Result.List_Extraction()
; processing
BackrefExtractRegularExpression(rh, CHAINE$, tableau_extraction(), Result())
Debug ""
Debug ""
Debug "#### Recurrent extraction test :"
Debug ""
Debug "Starting text :"
Debug CHAINE$
Debug "Regex = ||" + REGEX$ + "||"
Debug ""
Debug "Extracted values :"
Debug ""
b = 0
ForEach Result()
Debug "Occurrence " + Str(b)
For a = 0 To 2
Debug "$" + Str(a) + " = " + Result()\Extract(a)
Next
b + 1
Next