Use libxml2 in Linux 64 bits lazarus / 66-Unix ---------------------------------------------------------------------- almp1 · 2016-07-25 02:12 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 · 2016-07-25 05:23 Quote from: almp1 on July 25, 2016, 04:12:38 amLinux 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 Since loadlibrary is a function returning a result, what does it return for you ? Note the part: QuoteIf the library cannot be loaded, NilHandle is returned. ---------------------------------------------------------------------- mig-31 · 2016-07-25 08:04 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 · 2016-07-25 14:01 Hi Molly The return has been a valid integer. In my code there is a line below Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      libHandle: = LoadLibrary ('libxml2.so');   if libHandle <> 0 then   begin     __emptyExp: = xmlExpNodePtrPtr (GetProcAddress (libHandle 'emptyExp'));  Still, thanks for the reply ---------------------------------------------------------------------- almp1 · 2016-07-25 14:04 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 ---------------------------------------------------------------------- molly · 2016-07-25 16:41 Quote from: almp1 on July 25, 2016, 04:01:51 pmThe return has been a valid integer. In my code there is a line below Hmz strange. Are you perhaps compiling a 64-bit program and loading a 32-bit version of the library ? ---------------------------------------------------------------------- almp1 · 2016-07-25 17:00 Hi molly Prepared every environment in 64bits, on a separate machine. I made sure to ensure that no library 32bits stay active. So was the test environment: CentOS7 64bits Lazarus 1.6 and FPC 3.0 64bits installed using RPM packages Although the libraries are available in the yum repository CentOS7, updated packages to their latest versions. The xmlsec, xml2 and xslt libraries were downloaded here ftp://xmlsoft.org/libxml2/ thanks for the reply ---------------------------------------------------------------------- Jonas Maebe · 2016-07-26 11:31 Is the type of the variable in which you store the result of loadlibrary "TLibHandle"? It's an integer type, so if you assign it to a 32 bit variable it will compile, but you will be truncating the handle. Try compiling with range checking enabled to catch such errors. ---------------------------------------------------------------------- almp1 · 2016-07-27 03:44 Hi  Jonas Maebe I used your idea to change the type declaration of variable libhandle. I was thus declaring libhandle: THandle. I made a change to libhandle: TLibHandle. With this I managed to pass the __emptyExp: = xmlExpNodePtrPtr (GetProcAddress (libHandle 'emptyExp')); Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  //libHandle: THandle;  libHandle: TLibHandle;begin libHandle: = LoadLibrary ('libxml2.so');   if libHandle <> 0 then   begin     __emptyExp: = xmlExpNodePtrPtr (GetProcAddress (libHandle 'emptyExp'));  Now I have other pair identify challenges, but already helped me a lot Thank you ---------------------------------------------------------------------- greaseflog · 2017-12-09 00:02 When the EError happen in Windows64 Ultimate that i have to do? erro Illegal conversion type "LongInt" to "Integer" code result.AddObject(wDescri, TObject (wCodigo))   ; Lazarus 1.6 SVN r51630 FPC 3.0.0 x86_64-win64-win32/win64