Tperlregex component fatal error L3169?

I have been using Tperlregex for some time now. but today, when I try to compile an application built using Tperlregex, it causes a "fatal error: L3169 internal error".

reg: Tperlregex; begin reg:=Tperlregex.create(nil); //If this line is removed, there is no error prompt. ... ... end; 

I am using Perlregex2009.

Please, help.

Edit:

Andreas, Thank you so much.

@Andreas Thank you so much for your reply. I am using Delphi 7. Does your answer work on D7. And I find notes in pcre.pas (.. Delphi 2009 and earlier have a compiler error that can cause an internal error if you install TPerlRegEx in the development time package, and you do not put TPerlRegEx in the run-time package at the same time. Since Delphi 2009 and earlier you you can use PCRE_STATICLINK if you don’t use packages at all (this means that you are not installing it in the IDE ...). I have not installed it in the IDE and I put the perlregex module in the interface. I install these lines in pcre. pas

  ... {$DEFINE PCRE_LINKDLL} {$IFDEF PCRE_STATICLINK} {$UNDEF PCRE_LINKDLL} {$ENDIF} 

He used to work. But today it is not.

+4
source share
1 answer

Delphi 2009 seems to have problems exporting the * .obj file. The pcre_exec function pcre_exec be called from code. If Delphi "smart linker" deletes it because it is not called anywhere in the code (which is not removed by the smart linker), the compiler fails. This is a compiler error, but you can get around it by making a small change to the PerlRegEx library. You must add the local procedure "UseFunction" (and a call to it) in the constructor TPerlRegEx.Create . Therefore, when you create a TPerlRegEx object, the smart linker does not remove the pcre_exec function.

 constructor TPerlRegEx.Create(AOwner: TComponent); procedure UseFunction(P: Pointer); begin end; begin UseFunction(@pcre_exec); // if not used, D2009 will fail with internal compiler error UseFunction(@pcre_compile); // if not used, D7 will fail with internal compiler error inherited Create(AOwner); end; 
+10
source

Source: https://habr.com/ru/post/1383190/


All Articles