You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Juergen Hermann <jh...@webde-ag.de> on 2000/03/02 17:03:35 UTC

xml-xerces build on Linux

Hi!

I encountered the following problems with my (eventually 
successful) build...

Environment:
    Linux 2.0.36 (Suse 6.1, glibc 2.0)
    egcs-2.91.60

Files that I needed to change:
    src/runConfigure
    src/util/Platforms/Linux/LinuxPlatformUtils.cpp

--- src build ---------------------------------------------------------

The x flag is not set after I do a checkout, so I need to do

    chmod a+x runConfigure configure

This might be normal CVS behaviour, but then above line should
be added to the build intructions.

I needed to add the -z-D__USE_UNIX98 option to get

    ./util/Platforms/Linux/LinuxPlatformUtils.cpp

to compile.

And the -z option did not work at all (see diff below). :)

Then, I could do

runConfigure -plinux -cgcc -xg++ -minmem -nfileonly -tnative -z-D__USE_UNIX98

Finally, I had to replace the call to pthread_mutexattr_settype
with pthread_mutexattr_setkind_np.

-----------------------------------------------------------------------

--- runConfigure        2000/02/25 03:42:56     1.22
+++ runConfigure        2000/03/02 14:25:12
@@ -481,10 +481,10 @@
 # Set the extra C and C++ compiler flags
 #

-CXXFLAGS="$debugflag $transcodingDefines $msgloaderDefines $threadingDefines $netaccessorDefines"
+CXXFLAGS="$compileroption $debugflag $transcodingDefines $msgloaderDefines $threadingDefines $netaccessorDefines"
 export CXXFLAGS

-CFLAGS="$debugflag $transcodingDefines $msgloaderDefines $threadingDefines $netaccessorDefines"
+CFLAGS="$compileroption $debugflag $transcodingDefines $msgloaderDefines $threadingDefines $netaccessorDefines"
 export CFLAGS

 LIBS="$transcodingLibs $threadingLibs $netaccessorLibs"


--- util/Platforms/Linux/LinuxPlatformUtils.cpp 2000/02/22 00:58:15     1.10
+++ util/Platforms/Linux/LinuxPlatformUtils.cpp 2000/03/02 14:27:37
@@ -555,7 +555,7 @@
     pthread_mutex_t* mutex = new pthread_mutex_t;
     pthread_mutexattr_t*  attr = new pthread_mutexattr_t;
     pthread_mutexattr_init(attr);
-    pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE_NP);
+    pthread_mutexattr_setkind_np(attr, PTHREAD_MUTEX_RECURSIVE_NP);
     if (pthread_mutex_init(mutex, attr))
     {
         ThrowXML(XMLPlatformUtilsException,




Re: compiling XercesLib.dll under Borland Builder 5

Posted by Andy Heninger <he...@us.ibm.com>.
I'm not sure what Borland Builder 5 does, but it seems that
Microsoft changed the argument types for the InterlockedCompareExchange()
function very recently, which has resulted in the same problem
being seen when used with their latest SDK files.

It smells like the same problem.

The ultimate solution is probably to dump the requirement
for compareAndSwap().  It was there to try to speed up DOMString,
but that code was buggy, and no longer exists.  So there's
no need pressing need to keep CompareAndSwap, although there are
a number of uses that would need to be changed before removing it.

For an immediate fix, though, just add casts to the invocation
of ::InterlockedCompareExchange() that match the function prototype
that came with your development environment.

  -- Andy


----- Original Message -----
From: "Gareth Reakes" <ga...@decisionsoft.com>
To: <xe...@xml.apache.org>
Sent: Thursday, March 02, 2000 9:54 AM
Subject: compiling XercesLib.dll under Borland Builder 5


> Hi,
> trying to compile under builder 5 I am getting the follwing errors:
>
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void * *'
> to 'long *'
> [C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
> parameter 'Destination' (wanted 'long *', got 'void * *')
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
> to 'long'
> [C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
> parameter 'Exchange' (wanted 'long', got 'void *')
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
> to 'long'
> [C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
> parameter 'Comperand' (wanted 'long', got 'void *')
> [C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'long' to
> 'void *'
>
>
> relating to c\src\util\Platforms\Win32\Win32PlatformUtils.cpp
>
> //
> --------------------------------------------------------------------------
-
> //  Miscellaneous synchronization methods
> //
> --------------------------------------------------------------------------
-
> void*
> XMLPlatformUtils::compareAndSwap(       void**      toFill
>                                 , const void* const newValue
>                                 , const void* const toCompare)
> --cut out not relevant stuff
>
>     #else
>
>     //
>     //  Note we have to cast off the constness of some of these because
>     //  the system APIs are not C++ aware in all cases.
>     //
>     return ::InterlockedCompareExchange
>     (
>         toFill
>         , (void*)newValue
>         , (void*)toCompare
>     ); ----line 621
>     #endif
> }
>
>
> have looked at the source and can not see how this would work!!
>
> any help is greatly appreciated
>
> --
> Gareth Reakes, Software Engineer
> XML Script/X-Studio Development Team           Office: 44-1865-203192
> http://www.xmlscript.org/                      Mobile: 44-7797-503087
>


compiling XercesLib.dll under Borland Builder 5

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	trying to compile under builder 5 I am getting the follwing errors:

[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void * *'
to 'long *'
[C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
parameter 'Destination' (wanted 'long *', got 'void * *')
[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
to 'long'
[C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
parameter 'Exchange' (wanted 'long', got 'void *')
[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'void *'
to 'long'
[C++ Error] Win32PlatformUtils.cpp(621): E2342 Type mismatch in
parameter 'Comperand' (wanted 'long', got 'void *')
[C++ Error] Win32PlatformUtils.cpp(621): E2034 Cannot convert 'long' to
'void *'


relating to c\src\util\Platforms\Win32\Win32PlatformUtils.cpp

//
---------------------------------------------------------------------------
//  Miscellaneous synchronization methods
//
---------------------------------------------------------------------------
void*
XMLPlatformUtils::compareAndSwap(       void**      toFill
                                , const void* const newValue
                                , const void* const toCompare)
	--cut out not relevant stuff

    #else

    //    
    //  Note we have to cast off the constness of some of these because
    //  the system APIs are not C++ aware in all cases.
    //
    return ::InterlockedCompareExchange
    (
        toFill
        , (void*)newValue
        , (void*)toCompare
    );							----line 621
    #endif
}


have looked at the source and can not see how this would work!!

any help is greatly appreciated

-- 
Gareth Reakes, Software Engineer
XML Script/X-Studio Development Team           Office: 44-1865-203192
http://www.xmlscript.org/                      Mobile: 44-7797-503087