You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Mihai Matei <mi...@yahoo.com> on 2007/05/04 16:09:38 UTC

HP-UX, aCC and namespace std

Hi,

    Summary: 'using namespace std' does not work with Xerces-C 2.7.0 on hp-ux 11.11 parisc and aCC A.03.73

    Long version:
    I have the following problem with Xerces-C 2.7.0, I'm compiling on hp-ux parisc 11.11 with aCC A.03.73:

    #./runConfigure -php-11 -ccc -xaCC -ok
    #gmake                                             -ok

    #file libxerces-c.sl.27.0
    libxerces-c.sl.27.0:    PA-RISC1.1 shared library -not stripped

    #ldd libxerces-c.sl.27.0 |more
        /usr/lib/libnsl.1 =>    /usr/lib/libnsl.1
        /usr/lib/libxti.2 =>    /usr/lib/libxti.2
        /usr/lib/libpthread.1 =>        /usr/lib/libpthread.1
/usr/lib/dld.sl: Unresolved symbol:     symbol not found: __PureVirtualCalled   (libxerces-c.sl.27.0)
    ...(above line repeated)
    That's ok, the examples work:

    #../bin/CreateDOMDocument
    The tree just created contains: 4 elements.

BUT!!!

    My question is why is Xerces picking up the 'old' header file <iostream.h> instead of <iostream>? I searched in the source code for the XERCES_NEW_IOSTREAMS macro, it is defined for a few architectures, but could not fine it defined for hp-ux/aCC. 
    The problem is when I try linking my program with the C++ Standard Lib, I compile with '-AA', and link with '-lstd_v2 -lCsup_v2'. If I do this, the example would not work anymore! 
#./test
The tree just created contains:  <-- nothing
...and other examples even abort

 Plus, there are a lot of comments like the following in the source code:

 * Revision 1.8  2003/05/30 09:36:35  gareth
 * Use new macros for iostream.h and std:: issues.

    What are those issues and how can I get around them?

    Then, in XercesDefs.hpp:

#if defined(XERCES_STD_NAMESPACE)
    #define XERCES_USING_STD(NAME) using std :: NAME;

    which means I cannot do a 'using std::vector' for example, because the std namespace is not defined (unless I compile with -AA, but I run into problems with Xerces, see above).

    Any ideas?

Thank you!!









__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: HP-UX, aCC and namespace std

Posted by David Bertoni <db...@apache.org>.
Mihai Matei wrote:
> Hi,
> 
>     Summary: 'using namespace std' does not work with Xerces-C 2.7.0 on hp-ux 11.11 parisc and aCC A.03.73
> 
>     Long version:
>     I have the following problem with Xerces-C 2.7.0, I'm compiling on hp-ux parisc 11.11 with aCC A.03.73:
> 
>     #./runConfigure -php-11 -ccc -xaCC -ok
>     #gmake                                             -ok
> 
>     #file libxerces-c.sl.27.0
>     libxerces-c.sl.27.0:    PA-RISC1.1 shared library -not stripped
> 
>     #ldd libxerces-c.sl.27.0 |more
>         /usr/lib/libnsl.1 =>    /usr/lib/libnsl.1
>         /usr/lib/libxti.2 =>    /usr/lib/libxti.2
>         /usr/lib/libpthread.1 =>        /usr/lib/libpthread.1
> /usr/lib/dld.sl: Unresolved symbol:     symbol not found: __PureVirtualCalled   (libxerces-c.sl.27.0)
>     ...(above line repeated)
>     That's ok, the examples work:
> 
>     #../bin/CreateDOMDocument
>     The tree just created contains: 4 elements.
> 
> BUT!!!
> 
>     My question is why is Xerces picking up the 'old' header file <iostream.h> instead of <iostream>? I searched in the source code for the XERCES_NEW_IOSTREAMS macro, it is defined for a few architectures, but could not fine it defined for hp-ux/aCC. 
>     The problem is when I try linking my program with the C++ Standard Lib, I compile with '-AA', and link with '-lstd_v2 -lCsup_v2'. If I do this, the example would not work anymore! 

You should not specify the link libraries on the command line.  Instead, 
let the compiler add the appropriate libraries based on the -A option you 
specified.

The default for the aCC compiler on PA-RISC is -Aa, which specifies the old 
standard library.  Why don't you just update the compiler option in the 
file src/xercesc/Makefile.incl to add -AA to the compile and link options? 
  Or, you can try the -z and -l options for runConfigure.

> The tree just created contains:  <-- nothing
> ...and other examples even abort

You cannot mix -Aa and -AA binaries.  You need to chose one or the other.

Dave