Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> typedef and Pro*C/C++

typedef and Pro*C/C++

From: Alex Vinokur <alexander.vinokur_at_telrad.co.il>
Date: Mon, 25 Oct 1999 14:02:10 GMT
Message-ID: <7v1nsv$4fm$1@nnrp1.deja.com>


Hi,

I don't want to define my typedef's in *.pc files. I tried to do it in *.h file.

Here is a result.

How can we to do that?

        Thanks,
        Alex

//#########################################################
//------------------- Pro*C++ code : BEGIN ----------------

//==========================

// File zzz.h
#include <stdio.h>

#include <sqlca.h>
#include <sqlda.h>
#include <sqlcpr.h>
#include <oraca.h>

typedef char asci_str [123];
EXEC SQL TYPE asci_str IS STRING(123) REFERENCE;

//==========================


//==========================

// File zzz.pc
#include "zzz.h"

int main ()
{
EXEC SQL BEGIN DECLARE SECTION;
asci_str str1;
EXEC SQL END DECLARE SECTION;
        return 0;
}
//==========================

//==========================

//------------------- Pro*C++ code : END ------------------






//#########################################################
//------------------- Compilation Results : BEGIN ---------

code=cpp

sys_include=(/opt/SUNWspro/SC4.2/include,/opt/SUNWspro/SC4.2/include/CC,/usr/
include,/opt/SUNWspro/RW/workspaces/SOLARIS26/SUNPRO42/7s) code=cpp
sys_include=(/opt/SUNWspro/SC4.2/include,/opt/SUNWspro/SC4.2/include/CC,/usr/
include,/opt/SUNWspro/RW/workspaces/SOLARIS26/SUNPRO42/7s) proc code=cpp
sys_include='(/opt/SUNWspro/SC4.2/include,/opt/SUNWspro/SC4.2/include/CC,/usr /include,/opt/SUNWspro/RW/workspaces/SOLARIS26/SUNPRO42/7s)' iname=zzz MODE=ORACLE LINES=YES CPP_SUFFIX=cpp CHAR_MAP=STRING

Pro*C/C++: Release 8.0.5.0.0 - Production on Mon Oct 25 15:58:46 1999

(c) Copyright 1998 Oracle Corporation. All rights reserved.

System default option values taken from: /home/u01/app/oracle/product/8.0.5/precomp/admin/pcscfg.cfg

Semantic error at line 10, column 1, file zzz.h: EXEC SQL TYPE asci_str IS STRING(123) REFERENCE; 1
PCC-F-02354, A file included with #include may not contain SQL statements

INTERNAL ERROR: Failed Assertion [Code=40501]

make: *** [doit] Error 1


//------------------- Compilation Results : END -----------


//#########################################################
//------------------- Environment -------------------------

=== Oracle 8.0.5
=== Pro*C/C++ : Release 8.0.5.0.0

=== CC: WorkShop Compilers 4.2 30 Oct 1996 C++ 4.2 === SunOS 5.6
//---------------------------------------------------------

//#########################################################



Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Oct 25 1999 - 09:02:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US