Reputation: 319
IDEs on separate machines both WinXP. The versions/date of LibXML2.dll
vary in both machines from 2010 to 2012.
I am installing libxml2.pas
from SourceForge (2.7.3) I created 3 apps, a console and a VCL Forms on XE2 and a VCL Forms on D2007.
If I do not reference a function in the Libxml2.dll
my app runs, if I reference a function
e.g. Doc:=xxmlParseFile(xnldocptr)
the app crashes at start up in InitUnits
.
program Project25;
uses
Forms,
Unit26 in 'Unit26.pas' {Form26};
{$R *.res}
begin<---------- Access violation here
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm26, Form26);
Application.Run;
end.
//Main Firm uses Libxml2;
{$R *.dfm}
procedure TForm26.FormCreate(Sender: TObject); var Doc: xmlDocPtr;
begin
Doc:=xmlParseFile('c:\a.xml');
xmlFreeDoc(Doc);
end
I can see that the module LibXML2 has been loaded.
Am I doing something silly or missing something?
Upvotes: 3
Views: 1455
Reputation: 11860
LIBXML2.DLL
itself depends on 2 other DLL's: ICONV.DLL
and ZLIB1.DLL
You can download the latest version of these dll's here
Make sure that these DLL's reside on the same path as your delphi executable.
I have tested your project under W7/Delphi XE and I don't receive an AV.
Upvotes: 7