![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have been using Pro*C/C++ for a while, but so far all my programs have been written in C. I just started trying to run some C++ programs, the ones that come with the precompiler: cppdemo[1-3].pc My problem is that I would like to modify the sys_include variable and I can't Every time I compile, there is a message: System default option values taken from: /home/oracle/product/10.2.0/ precomp/admin/pcscfg.cfg So, I figure that I need to modify that file. Since my Linux is RedHat, I remove the entry that mentions SuSe. I updated the list of C+ + directories. Even after those changes the precompiler seems to keep on searching include files in the wrong/old places. TIA, -Ramon ps: The only demo that builds fine is cppdemo2.pc, because it doesn't have an #include <iostream> statement. -------------------------------- Those include directories down here should NOT be there. I removed them from pcscfg.cfg proc code=cpp 'sys_include=(/home/oracle/product/10.2.0/precomp/ public,/usr/include,/usr/lib/gcc-lib/i486-suse-lin ux/2.95.3/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include,/ usr/lib/gcc-lib/i386-redhat-linux7/2.96/includ e)' iname=cppdemo3 |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Besides that, there is a Metalink Note 108440.1 (the note is about precompiler not able to find new style header files without .h extensions on Sun, but may apply to Linux as well), which essentially suggests following workarounds: 1) create symbolic links in your local directory to required headers (e.g. ln -s /usr/include/c++/4.1.1/iostream iostream.h) |
#5
| |||
| |||
|
|
Ramon F Herrera wrote: I have been using Pro*C/C++ for a while, but so far all my programs have been written in C. I just started trying to run some C++ programs, the ones that come with the precompiler: cppdemo[1-3].pc My problem is that I would like to modify the sys_include variable and I can't Every time I compile, there is a message: System default option values taken from: /home/oracle/product/10.2.0/ precomp/admin/pcscfg.cfg So, I figure that I need to modify that file. Since my Linux is RedHat, I remove the entry that mentions SuSe. I updated the list of C+ + directories. Even after those changes the precompiler seems to keep on searching include files in the wrong/old places. TIA, -Ramon ps: The only demo that builds fine is cppdemo2.pc, because it doesn't have an #include <iostream> statement. -------------------------------- Those include directories down here should NOT be there. I removed them from pcscfg.cfg proc code=cpp 'sys_include=(/home/oracle/product/10.2.0/precomp/ public,/usr/include,/usr/lib/gcc-lib/i486-suse-lin ux/2.95.3/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include,/ usr/lib/gcc-lib/i386-redhat-linux7/2.96/includ e)' iname=cppdemo3 Warning mentioned by you seems to come from $ORACLE_HOME/precomp/lib/env_precomp.mk, there is the following hardcoded definition of CPLUS_SYS_INCLUDE: SYS_INCLUDE_PATH=/usr/include,/usr/lib/gcc/i386-redhat-linux/4.1.1/include,/usr/lib/gcc/i386-redhat-linux/3.4.5/include,/usr/l ib/gcc-lib/i386-redhat-linux/3.2.3/include,/usr/lib/gcc/i586-suse-linux/4..1.0/include SYS_INCLUDE='sys_include=($(ORACLE_HOME)/precomp/public,$(SYS_INCLUDE_PATH))' CPLUSPLUS=g++ CPLUS_SYS_INCLUDE='sys_include=($(ORACLE_HOME)/precomp/public,$(SYS_INCLUDE_PATH))' Despite the warning, c++ demos seem to compile fine on my system ( 11gR1 , RedHat 5.3) Besides that, there is a Metalink Note 108440.1 (the note is about precompiler not able to find new style header files without .h extensions on sun, but may apply to Linux as well), which essentially suggests following workarounds: 1) create symbolic links in your local directory to required headers ( e.g. ln -s /usr/include/c++/4.1.1/iostream iostream.h) 2) modify your sample program to enclose all includes into infndef block (then the verification of headers will be skipped by precompiler and deferred to compilation time, which should be ok) *like: #ifndef ORA_PROC /* include all of the header files with no extension */ #include <ostream #include <istream #include ..... #endif I just tried the second workaround and it does indeed eliminated precompiler warnings. Best regards Maxim |
#6
| |||
| |||
|
|
I will have more questions and comments about the precompiler, as I claim that it provides the fastest possible access to Oracle, compared with alternatives such as Java or PL/SQL. |
#7
| |||
| |||
|
|
On Sep 6, 10:04*am, Ramon F Herrera <ra... (AT) conexus (DOT) net> wrote: snip I will have more questions and comments about the precompiler, as I claim that it provides the fastest possible access to Oracle, compared with alternatives such as Java or PL/SQL. Have fun ... I think the point is that depending on what you can do with C ... you can write some fast running programs against an oracle database. You will have to do apples to apples comparisons in the types of processing you do in plsql versus c of course. It would be real nice to have some benchmarked samples for test cases of C versus plsql versus java! |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
I have a new question. I took a C program that precompiled, compiled, linked and executed perfectly. Now I am trying to convert it into a C++ program. My current problem is that the following four variables are not recognized by the C++ precompiler: varchar username[UNAME_LEN]; varchar password[PWD_LEN]; EXEC SQL CONNECT :username IDENTIFIED BY assword;int howMany; varchar table_name[SOME_SIZE]; EXEC SQL SELECT COUNT(1) INTO :howMany FROM user_tables WHERE table_name = :table_name; It seems like the variables embedded into the EXEC SQL statements need a different syntax? TIA, -Ramon I'm not a c/c++ developer by any means,so forgive me if i ask too |
#10
| |||
| |||
|
|
I have a new question. I took a C program that precompiled, compiled, linked and executed perfectly. Now I am trying to convert it into a C++ program. My current problem is that the following four variables are not recognized by the C++ precompiler: varchar * * * * username[UNAME_LEN]; varchar * * * * password[PWD_LEN]; EXEC SQL CONNECT :username IDENTIFIED BY assword;int howMany; varchar table_name[SOME_SIZE]; EXEC SQL SELECT COUNT(1) INTO :howMany FROM user_tables WHERE table_name = :table_name; It seems like the variables embedded into the EXEC SQL statements need a different syntax? TIA, -Ramon |
![]() |
| Thread Tools | |
| Display Modes | |
| |