Operating System - OpenVMS
1825768 Members
1958 Online
109687 Solutions
New Discussion

Porting VisualC++ to Compaq C++

 
SOLVED
Go to solution
P R Stone_1
Advisor

Porting VisualC++ to Compaq C++

I am looking at XML Bindings for C++ and have used XMLSpy to generate C++ code. Unfortunately it only generates MS Visual C++ that I can't get to compile on Compaq C++ V6.5-004 for OpenVMS Alpha V8.2.

The compiler option /STANDARD=MS seems to handle the string handling (eg _T.. and _sntprintf) with a version of tchar.h.
$cxx ALTOVAEXCEPTION.CPP -
/STANDARD=MS -
/DEFINE=(HAVE_STRSTREAM) -
/INCLUDE=("CXX$USER_INCLUDE/","CXX$ALTOVA_INCLUDE/")

However I get the following error
#error "cannot include ostream -- define __USE_STD_IOSTREAM to override default
- see section 7.1.2 of the C++ Using Guide"
.^
%CXX-E-ERRDIRECTIVE, #error directive: "cannot include ostream -- define
__USE_STD_IOSTREAM to override default - see section 7.1.2 of the
C++ Using Guide"
at line number 58 in module OSTREAM. of text library SYS$COMMON:[SYSLIB]CXXL$ANS
I_DEF.TLB;1

inline tostream& operator<<(tostream& os, CSchemaType& t)
.......^
%CXX-E-NOTMEMBER, namespace "std" has no member "ostream"

But the MS options uses the old iostream. If I use the std iostream as follows:
$cxx ALTOVAEXCEPTION.CPP -
/STANDARD=MS -
/DEFINE=(__USE_STD_IOSTREAM,HAVE_STRSTREAM) -
/INCLUDE=("CXX$USER_INCLUDE/","CXX$ALTOVA_INCLUDE/")

Then I get
#pragma do_not_instantiate std::istreambuf_iterator
> std::num_get > >:
:do_get(std::istreambuf_iterator >, std::istreambuf
_iterator................................................................................
...^
std::char_traits >, std::ios_base &, int &, long long &) const
%CXX-E-NOMATTYPOVLFUN, no instance of overloaded function "std::num_get InputIterator>::do_get [with charT=char,
InputIterator=std::istreambuf_iterator std::char_traits>]" matches the specified type
at line number 617 in module NUMERAL. of text library SYS$COMMON:[SYSLIB]CXXL$AN
SI_DEF.TLB;1

Am I missing something. Or is it going to be easier to rewrite the original code to strip out the MS extensions?

Alternatively is there a simple XML binding compiler available?
1 REPLY 1
Hoff
Honored Contributor
Solution

Re: Porting VisualC++ to Compaq C++

The Microsoft Visual C++ IDE is an integrated and core component of the Windows operating system and related environments; it's a powerful platform IDE; very far beyond what I would consider a compiler in the classic sense. It's really quite good at generating Windows MSC++ code, and it has an impressively detailed knowledge of Windows and Windows APIs and fully integrates that into the generated MSC++ source code.

As for other options, I've been porting across libxml2 libraries and related. There's a libxml++ wrapper around, too.

And for your question, I'd take a look at the codesynthesis xsd tool over at at http://codesynthesis.com/products/xsd/ -- I don't know that it has been ported.

There's an XSD SDL tool around, too. SDLXSD, Not sure if that generates from or into SDL, but I'd take a look at that. SDL is the core API and data structure definition language for OpenVMS.