Operating System - Linux
1755994 Members
3223 Online
108839 Solutions
New Discussion

Re: aCC doesn't like OCCI_STD_NAMESPACE::

 
Ben England
New Member

aCC doesn't like OCCI_STD_NAMESPACE::

I'm having trouble building an Oracle OCCI app that also uses Iona Orbix on HP-UX 11i This app works fine on Tru64 Compaq UNIX. I'm using aCC V3.33, Oracle 9iRAC, and Iona Orbix E2A Std Edition. The problem is that the compile of a sample Oracle OCCI program

/opt/aCC/bin/aCC -c -v -AP +DAportable -mt -I$ORACLE_BASE/rdbms/demo
-I$ORACLE_BASE/rdbms/public occidml.cpp

where occidml.cpp is:

#include
#include
#include
#include
using namespace oracle::occi;
using namespace std;

gets errors like this:

Error 19: "/ora1/oracle/OraHome1/rdbms/demo/occiCommon.h", line 586 # Unexpected
'std'.
void getVector( const AnyData &any, OCCI_STD_NAMESPACE::vector &ve
ct, Type typ ) ;
^^^^^^^^^^^^^^^^^^

where compiler complains about std::vector and such. This should be perfectly legal if #include has already happened, and I made sure it did.

However, with -AA the problem goes away. I can't figure out why this matters. My workaround at present is to take out all occurrences of OCCI_STD_NAMESPACE:: in rdbms/demo/occi*.h, when I do this it compiles and links and runs fine. However, I have to link against -lstd_v2 -lCsup_v2 (apparently Oracle built its libraries with -AA.

This whole thing is a pain because Orbix was NOT built with -AA I can't get Orbix to link successfully with -AA (another problem).

My best attempt was:

shlib_dir=$IT_PRODUCT_DIR/orbix_art/2.0/cxx/lib
inc_dir=$IT_PRODUCT_DIR/orbix_art/2.0/cxx/include
aCC -v -AA -DIT_STD +DAportable -mt +p -I$inc_dir -o orbix_test orbix_test.cpp -L$shlib_dir -L$IT_PRODUCT_DIR/shlib -L$IT_PRODUCT_DIR/shlib/default -Wl,+n -Wl,+k -Wl,-E -Wl,-Bimmediate -Wl,-Bverbose -Wl,-Bsymbolic -Wl,+s -Wl,+vshlibunsats -lit_art

where orbix_test.cpp was:

#include "rtods.hh"

int main( int argc, char * argv[])
{
return 0;
}

which includes the IDL-generated client stub include file and nothing else. The above example compiles and links fine when -AA -DIT_STD are removed from compile/link command.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: aCC doesn't like OCCI_STD_NAMESPACE::

As you found namespace std is not available unless you use -AA. You may be able to define OCCI_STD_NAMESPACE to empty?