I've got some embedded sql sources which I shall translate with the
precompiler "proc". Unfortunately, it doesn't work for me:
-------------------------8<--------------------------------------------
> proc mysql.pc
Pro*C/C++: Release 8.1.7.0.0 - Production on Tue May 14 15:19:28 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
System default option values taken from: /opt/oracle/OraHome/precomp/admin/pcscf
Error at line 34, column 11 in file /usr/include/stdio.h
# include <stddef.h>
..........1
PCC-S-02015, unable to open include file
[...]
-------------------------8<--------------------------------------------
This looks if the precompiler would not find some standard header
files. I then tried to pass the header paths as command line option
also fails:
-------------------------8<--------------------------------------------
> proc INCLUDE=/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include \
INCLUDE=/opt/oracle/product/8.1.6/rdbms/demo mysql.pc
[...]
Syntax error at line 117, column 2, file /usr/lib/gcc-lib/i486-suse-linux/2.95.2Error at line 117, column 2 in file /usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h
#include_next <limits.h> /* recurse down to the real one */
.1
PCC-S-02014, Encountered the symbol "include_next" when expecting one of the following:
a numeric constant, newline, define, elif, else, endif,
error, if, ifdef, ifndef, include, line, pragma, undef,
an immediate preprocessor command, a C token,
The symbol "newline," was substituted for "include_next" to continue.
-------------------------8<--------------------------------------------
This looks now really funny to me.
So, I have now a couple of questions:
- This is my first use of "proc", is there anything which I did wrong?
Maybe, the precompiler isn't installed correctly? How do I test that?
- How cat I force "proc" to compile successfully files on Linux (gcc)?
- Is the use of files from the "demo" dir usual in oracle (the source
uses the file "oratypes.h")? Do I then really need to specify the
directory?
- How can I call "proc" system independent? I want to include the
sources in a package that shall be build with "autoconf/automake".
I am using Oracle 8.1.6 and 8.1.7 and SuSE Linux 7.0 and 7.3.
Any suggestions?
Ole
Ole Streicher wrote:
>
>>proc INCLUDE=/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include \
>>
> INCLUDE=/opt/oracle/product/8.1.6/rdbms/demo mysql.pc
> [...]
> Syntax error at line 117, column 2, file /usr/lib/gcc-lib/i486-suse-linux/2.95.2Error at line 117, column 2 in file /usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h
> #include_next <limits.h> /* recurse down to the real one */
> .1
> PCC-S-02014, Encountered the symbol "include_next" when expecting one of the following:
> - This is my first use of "proc", is there anything which I did wrong?
No, you did nothing wrong. The precompiler doesn't recognise
include_next (and the first fix treated it as just "include" resulting
in an infinite loop). It is correctly handled in 8.1.7.3.
Alternatively wrap the include with #ifndef ORA_PROC/#endif - the
precompiler defines the symbol ORA_PROC. This ifndef construct provides
a workaround to the majority of bugs.
> - Is the use of files from the "demo" dir usual in oracle
demo_proc.mk is capable of building a large number of
differently-configured projects, and only needs modifying if you want to
link in additional libraries. demo_proc.mk itself is fairly standard,
env_precomp.mk contains the platform dependent stuff. The syntax for
demo_proc.mk, supposing you want to build myprog from pc1.pc, pc2,pc,
cc1.c, cc2.c, is:
make -f demo_proc.mk build EXE=myprog OBJS="pc1.o pc2.o cc1.o cc2.o"
The .pc.o and .c.o rules in the makefile determine which files need
precompiling and compiling. Just have a look through the makefile for
other stuff it can do. The above uses the build target, so for details
on this particular process look (in vi) for ^build: and you should find it.
> - How can I call "proc" system independent? I want to include the
> sources in a package that shall be build with "autoconf/automake".
The above command is very system independent and works on Linux, HP,
Solaris, AIX....all supported Un*x platforms in fact. VMS and Windows
need different commands of course.
>
> I am using Oracle 8.1.6 and 8.1.7 and SuSE Linux 7.0 and 7.3.
>
> Any suggestions?
>
> Ole
>
--
David Spencer
www.curlypi.com
Email address munged to avoid SPAM.
David Spencer <David.W...@elcaro.moc> writes:
> >>proc INCLUDE=/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include \
> > #include_next <limits.h> /* recurse down to the real one */
> > PCC-S-02014, Encountered the symbol "include_next" [...]
> No, you did nothing wrong. The precompiler doesn't recognise
> include_next (and the first fix treated it as just "include" resulting
> in an infinite loop). It is correctly handled in 8.1.7.3.
Is there a possibility just to install the new "pro/C" precompiler
without the need to download the complete Oracle disc?
> Alternatively wrap the include with #ifndef ORA_PROC/#endif - the
> precompiler defines the symbol ORA_PROC. This ifndef construct
> provides a workaround to the majority of bugs.
This seems not to work: my program wants to #include "oratypes.h"
which is in /opt/oracle/OraHome/rdbms/demo/. This file itself does
#include <stddef.h> which leads to the mentioned error. I can't wrap
around oratypes.h as you recommended since the pro/c compiler then
complains about some types it can't resolve.
Can you help me again a bit here?
Tanks and Tschuessi
Ole
Open the pcscfg.cfg file in $ORACLE_HOME/precomp/admin folder
and add the following settings. After this, it should work.
---
sys_include=(/usr/include, /usr/include/sys,
/usr/lib/gcc-lib/i386-glibc21-linux/egcs-2.91.66/include)
include=(/opt/oracle/product/8.1.7/precomp/public)
include=(/opt/oracle/product/8.1.7/rdbms/public)
include=(/opt/oracle/product/8.1.7/rdbms/demo)
---
BTW, we are using Oracle 8.1.7 on RedHat Linux 7.2
It could be different on your version.
HTH
- MC
"Ole Streicher" <ole-us...@gmx.net> wrote in message
news:qfg00ue...@ebp00439.ebp.de...
"MC" <m...@somewhere.com> writes:
> Open the pcscfg.cfg file in $ORACLE_HOME/precomp/admin folder
> and add the following settings. After this, it should work.
Thank you, this helps to overcome the first errors. But, in general,
it works only partly. The first files compile, others show still
errors. I used:
sys_include=(/usr/include, /usr/include/sys,/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include)
include=(/opt/oracle/OraHome/precomp/public)
include=(/opt/oracle/OraHome/rdbms/public)
include=(/opt/oracle/OraHome/rdbms/demo)
and get in one file the error
Error at line 1668, column 10 in file /opt/oracle/OraHome/rdbms/demo/oci.h
#include <ociextp.h>
.........1
PCC-S-02015, unable to open include file
[similar errors follow]
The file ociextp.h is in /opt/oracle/OraHome/rdbms/public/ and
readable, so it should be found with the include statements in the
pcscfg.cfg file. If I include it by hand as an INCLUDE= option, it
works but why doesn't it use the option from the config file?
The "real" big problem is now that is doesn't work with
mathcalls.h. One file gives the error
Syntax error at line 54, column 1, file /usr/include/bits/mathcalls.h:
Error at line 54, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL (acos,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "f" when expecting one of the following:
; , = ( [
this error is repeated several times (on different lines of
mathcalls.h), and then the compilation process crashes with an
"segmentation fault".
So, I am still a bit lost :-(
Any ideas?
Tschuessi
Ole
> The "real" big problem is now that is doesn't work with
> mathcalls.h. One file gives the error
> Syntax error at line 54, column 1, file /usr/include/bits/mathcalls.h:
> Error at line 54, column 1 in file /usr/include/bits/mathcalls.h
> __MATHCALL (acos,, (_Mdouble_ __x));
> 1
> PCC-S-02201, Encountered the symbol "f" when expecting one of the following:
> ; , = ( [
> this error is repeated several times (on different lines of
> mathcalls.h), and then the compilation process crashes with an
> "segmentation fault".
I experienced this a couple of days ago with Oracle 9i. When I
used the proc option parse=none, all this stuff went away. I wish
I knew what this means.
--
* Patrick L. Nolan *
* W. W. Hansen Experimental Physics Laboratory (HEPL) *
* Stanford University *
>In comp.databases.oracle.misc Ole Streicher <ole-us...@gmx.net> wrote:
>
>> The "real" big problem is now that is doesn't work with
>> mathcalls.h. One file gives the error
>
>> Syntax error at line 54, column 1, file /usr/include/bits/mathcalls.h:
>> Error at line 54, column 1 in file /usr/include/bits/mathcalls.h
>> __MATHCALL (acos,, (_Mdouble_ __x));
>> 1
>> PCC-S-02201, Encountered the symbol "f" when expecting one of the following:
>> ; , = ( [
>
>> this error is repeated several times (on different lines of
>> mathcalls.h), and then the compilation process crashes with an
>> "segmentation fault".
>
>I experienced this a couple of days ago with Oracle 9i. When I
>used the proc option parse=none, all this stuff went away. I wish
>I knew what this means.
Its been a while since I worked with Embedded SQL (Pro*C). The
problem is that the preprocessor is trying to parse your SQL against a
database. Setting parse=none tells the preprocessor not to try to verify your
SQL.
The MATHCALL errors are strange, but the PCC-S errors are normal if you
haven't set you compile environment up correctly.