Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Not able create a shared objects using gcc

1009876May 20 2013 — edited May 23 2013
We are currently in the process of migrating all middle tier code from SunOS into Oracle Linux(RHEL Kernel).
In top the Oracle Linux Server release 5.6 , Im trying to compile some of the .pc code using proc & gcc for create a shared objects...

But I got below error while create a shared objects...

c++ -g -o libdbutil.so -shared query.o Prepares.o ContextServer.o Utils.o DateUtil.o db_util.o statusCheck.o db_transact.o db_isolation.o DatabaseManager.o DateUtilOra.o

statusCheck.o: In function `__static_initialization_and_destruction_0':
/home/raj/statusCheck.cc:315: multiple definition of `sqlca'
db_util.o:/home/raj/include/log.h:80: first defined here
db_transact.o:/home/raj/db_transact.cc:391: multiple definition of `sqlca'
db_util.o:/home/raj/log.h:80: first defined here
db_isolation.o: In function `operator new(unsigned long, void*)':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/new:94: multiple definition of `sqlca'
db_util.o:/home/raj/log.h:80: first defined here
DatabaseManager.o:/home/raj/log.h:80: multiple definition of `sqlca'
db_util.o:/home/raj/log.h:80: first defined here
DateUtilOra.o: In function `__static_initialization_and_destruction_0':
/home/raj/DateUtilOra.cc:1252: multiple definition of `sqlca'
db_util.o:/home/raj/log.h:80: first defined here
collect2: ld returned 1 exit status
make: *** [libdbutil.so] Error 1


So I have tried with conditional preprocessor directivies while include the SQLCA header file.
Even not able to resolve the issue..

Please some help me to resolve the issue.
Thanks in advance.

Edited by: 1006873 on May 20, 2013 8:46 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2013
Added on May 20 2013
2 comments
1,140 views