Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Urgent help on using OCCI in Linux.
Hello there,
I am in urgent need to solve the following problem regarding use Oracle OCCI under Linux.
Could someone help me to solve this problem? Is OCCI so difficult to use?
the crash is caused by using getString(). If I commented out the second and third printf(), the program will be having no problem.
while (rs->next()) { printf("Book ID = %d\n", rs->getInt(1) ); printf("Title = %s\n", rs->getString(2).c_str() ); printf("Auther = %s\n", rs->getString(3).c_str() ); printf("Price = %d\n", rs->getInt(4) ); }
Thanks so much.
Steven
The OCCI I downloaded back is version 10.2.0.2, Instant Client Package - Basic
The following are some info of it.
Currently we use gcc 4.0.2 (gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8)), maybe they are not compatible.
Oracle C++ Call Interface - Downloads
OCCI for gcc 3.4.3 (Linux) Download (tar) OCCI 10.2.0.1.0 support files for building applications with gccversion 3.4.3 on RedHat Linux AS 4.0
Instant Client Downloads
for Linux x86
Version 10.2.0.2
Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
instantclient-basic-linux32-10.2.0.2-20060331.zip (33,901,074 bytes) (cksum - 2602139346)
*Instant Client Package - SQL*Plus: Additional libraries and executable for running SQL*Plus with Instant Client
instantclient-sqlplus-linux32-10.2.0.2-20060331.zip (740,155 bytes) (cksum - 3809431917)
*Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
instantclient-sdk-linux32-10.2.0.2-20060331.zip (602,224 bytes) (cksum - 3391827328)
I have been trying to find out what cause my app crash.
Here is the compiling and test result.
[LinuxMOne:stang] /home/stang/Desktop/occi/test> make
g++ -Wall -DLINUX -D_GNU_SOURCE -D_REENTRANT -g -I/home/stang/Desktop/occi/ include -c -o test1.o test1.cpp
g++ -Wall -DLINUX -D_GNU_SOURCE -D_REENTRANT -g -I/home/stang/Desktop/occi/ include -locci -lclntsh -lociei -lnnz10 -locci -lclntsh -lociei -lnnz10 -o test1 test1.o
/usr/bin/ld: warning: libstdc++.so.5, needed by /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../libocci.so, may conflict with libstdc++.so.6
[LinuxMOne:stang] /home/stang/Desktop/occi/test> test1
Enter main ...
Enter login_info ...
====Restriction List====
=name= =ip= =port=
name = www.shaw.ca
ip = 33.33.33.33
Segmentation fault
[LinuxMOne:stang] /home/stang/Desktop/occi/test>
Now I am thinking it must be something to do with the compile warning:
/usr/bin/ld: warning: libstdc++.so.5, needed by /usr/lib/gcc/i386-redhat-linux/4.0.2/../../../libocci.so, may conflict with libstdc++.so.6
Any idea and solution?
Thanks,
Steven.Tang_at_mobidia.com
Now I changed the Linux to be RedHat EL AS 4 and gcc 3.4.5-2, I still got the program aborted:
See the following info for detail.
Anyone there could help me please advise me what was wrong!!!
Thanks,
Steven
[magdev_at_magdev test]$ uname -a
Linux magdev 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 i686 i386
GNU/Linux
[magdev_at_magdev test]$ gcc --v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.5/specs
Configured with:
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --with-system-zli b --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
[magdev_at_magdev test]$ make
g++ -Wall -DLINUX -D_GNU_SOURCE -D_REENTRANT -g -I/usr/include/occi -c -o
test1.o test1.cpp
g++ -Wall -DLINUX -D_GNU_SOURCE -D_REENTRANT -g -I/usr/include/occi -locci
-lclntsh -lociei -lnnz10 -locci -lclntsh -lociei -lnnz10 -o test1 test1.o
/usr/bin/ld: warning: libstdc++.so.5, needed by
/usr/lib/gcc/i386-redhat-linux/3.4.5/../../../libocci.so, may conflict with
libstdc++.so.6
[magdev_at_magdev test]$ test1
-bash: test1: command not found
[magdev_at_magdev test]$ ./test1
Enter main ...
Enter login_info ...
Enter run() ...
Enter insertRows ...
SCOTT's salary = 60000, commission = 6000
Sleep for awhile to check ...
Enter deleteRows ...
The book table has book:
Book ID = 1
Title = The C++ Programming Language
*** glibc detected *** free(): invalid pointer: 0x09e557e0 ***
Aborted
Steven Tang Received on Thu Aug 03 2006 - 17:04:52 CDT
![]() |
![]() |