[xml] RE: Link error in libxml 2.6.7 on Win32 + crash



Hi Emanuel,

I compile my C program with  Microsoft Visual Studio 6.0, as a multithreaded
C runtime  DLL (using msvcrt.dll).
I link it statically with libxml_a.lib.
I call xmlReadFile() in the FIRST line of program, so there is no chance of
memory corruption or other effects.
In 2.6.7, this function crashes on Access Violation.

Interesting points:

1. If I call xmlReadFile() with a wrong file name the function returns a
valid error, so basically it is linked correctly.
2. I wrote a simple program that does ONLY xmlReadFile() (on the same XML
file) and exits. 
It is compiled and linked exactly like the real application and with the
same 2.6.7 include files and libraries. 
Amazingly, this test program works fine!
3. My program works fine with 2.6.4.

I'm in a lost. I need 2.6.7 for validating XML vs. schemas.

Thanks in advance




-----Original Message-----
From: Emanuel Dejanu [mailto:emanuel sw ro] 
Sent: Wednesday, March 17, 2004 8:59 AM
To: 'Israel Ganor'
Subject: RE: Link error in libxml 2.6.7 on Win32: ftol2



Hi Israel,

The problem is that you do not compile your program with the 
correct run-time library. What compiler do you use? If you 
use Microsoft Visual Studio 6.0 then you should check what 
run-time library. You should use multithreaded dynamic 
C-runtime (msvcrt.dll).


Igor Zlatković is using version 7 of the library that have 
the needed function.

With the simple patch that I had send to you I do not have 
any problem in my program. But I use only HTML parser.

The second option will be to compile yourself the library. 
This is a big task.

Emanuel

-----Original Message-----
From: Israel Ganor [mailto:ganor softlink com] 
Sent: Tuesday, March 16, 2004 3:30 PM
To: 'Emanuel Dejanu'
Cc: 'xml gnome org'
Subject: RE: Link error in libxml 2.6.7 on Win32: ftol2


Hi Emanuel,

Thanks, this solved the link problem.

Unfortunately I still cannot use libxml2 2.6.7. Now 
xmlReadFile() crasehes with access violation. With 2.6.4., 
xmlReadFile() on the same XML file works correctly. I link 
with static libxml_a.

Any idea?

Thanks in advance




-----Original Message-----
From: Emanuel Dejanu [mailto:emanuel sw ro]
Sent: Tuesday, March 16, 2004 12:17 PM
To: ganor softlink com
Cc: xml gnome org; igor zlatkovic com
Subject: RE: Link error in libxml 2.6.7 on Win32: ftol2



Hi,

Put the following in some cpp file and compile your 
project. Original 
link: http://q12.org/pipermail/ode/2004-January/010811.html


// only for MSDEV 6.0
#if (_MSC_VER == 1200) && (WINVER < 0x0500)
extern "C" long _ftol( double ); //defined by VC6 C libs extern "C"
long _ftol2( double dblSource ) { return _ftol( dblSource 
); } #endif

Best regards,

Emanuel Dejanu







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]