hi to all,
this is my environment which i configured on my own, so if you found any possibilities of bugs on this configuation means please let me know.
1. i installed redhat4 in two systems machine1 and machine2
2. @machine1 i installed oracle10g server
3. @machine2 i installed oracle10g client
4. and @all other xp systems inthat lab i put putty@telnet to work on this Machine2 redhat environment.
5. i wrote a c++ program with the bakend of oracle10g
6. the g++ command used to copile the CPP program along with link files worked properly and rised no bugs
7. the make command generates the appropriate object file with out any bugs too
8. when i tried to run the object file it throughs error as such linker file conflicts or duplicates or something.
so can any one help me to solve this problem
The test.cpp file:
#include <iostream>
#include <occi.h>
using namespace oracle:
cci;
using namespace std;
class testOcci{
private:
Environment *env;
Connection *conn;
Statement *stmt;
public:
testOcci (string user, string passwd, string db)
{
env = Environment::createEnvironment (Environment:
EFAULT);
conn = env->createConnection( user, passwd,db);
}
~testOcci ()
{
env->terminateConnection(conn);
Environment::terminateEnvironment (env);
}
};
int main(void)
{
string user="scott";
string passwd="tiger";
string db="spdc";
testOcci *demo = new testOcci (user, passwd, db);
cout << "Creation Successful" << endl;
delete (demo);
cout << "Deletion Successful" << endl;
return 0;
}
to find the occi.h file location using
find -name occi.h
the result is
./oracle/product/10.2.0/client_1/rdbms/public/occi.h
to compile the test.cpp program
g++ -L/home/oracle/oracle/product/10.2.0/client_1/lib -L/home/oracle/oracle/product/10.2.0/client_1/rdbms/public -I /home/oracle/oracle/product/10.2.0/client_1/rdbms/public -o test.o -c test.cpp
this generates 0 bugs, compiles successfully then to make the test.o program
make -f /home/oracle/oracle/product/10.2.0/client_1/rdbms/demo/demo_rdbms.mk buildocci EXE=run OBJS=test.o
this generates the following error
/usr/bin/g++ -L/home/oracle/oracle/product/10.2.0/client_1/lib/ -L/home/oracle/oracle/product/10.2.0/client_1/rdbms/lib/ -o run new.o -locci -lclntsh `cat /home/oracle/oracle/product/10.2.0/client_1/lib/sysliblist` -ldl -lm
/usr/bin/ld: warning: libstdc++.so.5, needed by /home/oracle/oracle/product/10.2.0/client_1/lib//libocci.so, may conflict with libstdc++.so.6
then when i use "ls -l" to list the files at the home directory along with its file types the result is
-rwxr-xr-x 1 oracle oinstall 478343213 May 21 06:14 10201_client_linux32.zip
-rw-r--r-- 1 oracle oinstall 27 May 28 11:04 afiedt.buf
drwxr-xr-x 6 oracle oinstall 4096 Jul 2 2005 client
drwxr-xr-x 2 oracle oinstall 4096 May 28 10:41 Desktop
-rw-r--r-- 1 oracle oinstall 671 May 28 11:20 test.cpp
-rw-r--r-- 1 oracle oinstall 5012 May 28 11:23 test.o
drwxrwx--- 3 oracle oinstall 4096 May 26 15:03 oracle
drwxrwx--- 6 oracle oinstall 4096 May 26 15:06 oraInventory
-rwxr-xr-x 1 oracle oinstall 50519 May 28 11:24 run
-rw-r--r-- 1 oracle oinstall 6032 May 28 10:40 sqlnet.log
so here at home directory the "test.o" generated but the problem is i couldnt execute this
[oracle@localhost ~]$ ./test
-bash: ./test: No such file or directory
so why this error arrising