Forum > Unix

Use libxml2 in Linux 64 bits

(1/2) > >>

almp1:
Hello friends!

I use in my projects to libxml2-pascal library https://sourceforge.net/projects/libxml2-pas/. Use a long time.
Already gone through various environments using this library. Used environments are as follows:
1) Lazarus 1.4.x FPC 2.6.x on Windows 7.8 and 10 32 and 64 bits
2) Lazarus 1.6.x FPC 3.0.x on Windows 7.8 and 10 32 and 64 bits
3) Lazarus 1.4.x FPC 2.6.x Linux, Centos 6.7 distribution and Ubuntu 12.x and 14.x 32bits
4) Lazarus 1.6.x FPC 3.0.x Linux, Centos 6.7 distribution and Ubuntu 12.x and 14.x 32bits

The libxml2 library, both the DLL as the .so are version 2.9.4

But I can not use the library on Linux 64bits. I really need to use this library in Linux 64bit environment, I've tried everything I know, but it is always displayed the exception message

Linux 64 environment can make the library loading with
LoadLibrary ( 'libxml2.so');

But when I use GetProcess such as the following line:
 xmlStringComment: = PAnsiChar (GetProcAddress (libHandle 'xmlStringComment'));

I get the message below

System design raised exception class 'External: SIGSEGV'.
The address 7FFFF7DE4DF0

I do not know what to do, will that someone could help me with any tips?

I thank you

molly:

--- Quote from: almp1 on July 25, 2016, 04:12:38 am ---Linux 64 environment can make the library loading with
LoadLibrary ( 'libxml2.so');

But when I use GetProcess such as the following line:
 xmlStringComment: = PAnsiChar (GetProcAddress (libHandle 'xmlStringComment'));

I get the message below

System design raised exception class 'External: SIGSEGV'.
The address 7FFFF7DE4DF0

--- End quote ---
Since loadlibrary is a function returning a result, what does it return for you ?

Note the part:

--- Quote ---If the library cannot be loaded, NilHandle is returned.

--- End quote ---

mig-31:
If your application 64-bit check the path /usr/lib/ for library exists, for 32-bit - /usr/lib32

If your see something like /usr/lib/libxml2.so.2.1 create a symbol link libxml2.so -> libxml2.so.2.1

almp1:
Hi Molly

The return has been a valid integer. In my code there is a line below


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---     libHandle: = LoadLibrary ('libxml2.so');   if libHandle <> 0 then   begin     __emptyExp: = xmlExpNodePtrPtr (GetProcAddress (libHandle 'emptyExp')); 
Still, thanks for the reply

almp1:
Hi mig-31

Yes I checked the symbolic links, they are correct. If I cause an error in the link symbolic return of LoadLibrary is NilHandle

Thanks for your response

Navigation

[0] Message Index

[#] Next page

Go to full version