Operating System - HP-UX
1752376 Members
5527 Online
108787 Solutions
New Discussion юеВ

Duplicate symbol "sqlca" in files <file1.o> <file2.o>

 
soumya das
Advisor

Duplicate symbol "sqlca" in files <file1.o> <file2.o>

I am getting the same problem as Peter's while running makefile. The error is Duplicate symbol "sqlca" in files .

My aCC version is
aCC: HP ANSI C++ B3910B A.03.33

Still I'm having the same error. can anyone pls. help me out?
17 REPLIES 17
Peter Godron
Honored Contributor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Soumya,
I was told version 3.33 would have the fix.

Have you tried ranganath ramachandra idea with the +allowdups ?
Available with the latest linker (PHSS_28434/PHSS_28436 : B.11.36).
Regards
soumya das
Advisor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Hi Peter,

Thanks for your reply.

I downloaded the patch. But how to use that "+allowdups" ? I have a makefile. Where this "+allowdups" is to be used? Can you help me in this regard.

--regards,
soumya
Peter Godron
Honored Contributor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

The link did not copy correctly, should be:
http://docs.hp.com/en/B2355-60105/ld_ia.1.html
soumya das
Advisor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Hi,
Thanks for the documentation.
I used "+allowdups" in LD_FLAGS option along with many other options like -Z and -b etc.

But the following error is still comming :

aCC: warning 901: unknown option: `+allowdups'

and the duplicate symbol "sqlca"

--regards,
soumya
Peter Godron
Honored Contributor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Soumya,
try the following:
remove the allowdup flag
include a -h sqlca in your link stage
This should hide the symbol at a local level.

I found the original problem and reply:
1201369430 andy_bennett@hp.com
"Hi Pete,

I've identified the problem you're seeing. It is a bug in the compiler and
listed as:

JAGad39135 -Ae enum constants, results in duplicate symbols at link
time

The problem is that the compiler is incorrectly making enum constants global
to the program whereas they should be local to the file being compiled. This
is resolved in aCC compiler revisions A.03.33 and later. You currently have
A.03.30. To obtain a later revision you will have to install a new compiler
from application CDs from December 2001 or later. Please see
http://hp.com/go/c++ for details of the revisions available and required
patches for each. The later the revision the better, but anything including
A.03.33 and after will resolve this problem."
soumya das
Advisor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Hi,

thanks for ur reply ..

Actually I have a makefile which is as shown in the attatchment. Pls. see the attatched notepad file.


Here in the LD_FLAG I am using those options loke -allowdups and -h sqlca as u said. But errors are coming saying these options are not allowed there.

The option +allowdups is working with ld separately for the object files.

Can u give any suggestions regarding how to modify my makefile so as to remove the duplicate sqlca errors?
Peter Godron
Honored Contributor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Soumya,
not attachment posted!
Regards
Peter Godron
Honored Contributor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Soumya,
an extract from our make script:
ld -h sqlca -h __SIGEV_NONE -h __SIGEV_SIGNAL -h __SIGEV_THREAD -h CLOCK_INVALID -h CLOCK_REALTIME -h CLOCK_V
IRTUAL -h CLOCK_PROFILE -h RTTIMER0 -h RTTIMER1 -h SI_QUEUE -h SI_USER -h SI_TIMER -h SI_ASYNCIO -h SI_MESGQ -h P_PID -h P_PGID -h P
_SID -h P_UID -h P_GID -h P_CID -h P_ALL -r -o 1.o
soumya das
Advisor

Re: Duplicate symbol "sqlca" in files <file1.o> <file2.o>

Hi peter,

following is the make file code .. I used in the LD_PATH those options like +allowdups and -h sqlca. But they are not allowed there.
These options are allowed with ld. I tried the +allowdups which worked with one warning of overriding the sqlca in one object file.


include ../../Include_Paths

CC = /opt/aCC/bin/aCC
CCFLAGS = -g0 +Z -D_HPUX_SOURCE -DRW_MULTI_THREAD -D_REENTRANT -mt
.SUFFIXES :
.SUFFIXES : .cc .h .pc .o

PROC_COMP = $(ORACLE_HOME)/bin/proc
PROC_FLAGS = CODE=CPP CPP_SUFFIX=cc
PROC_INCLUDE = SYS_INCLUDE=/opt/aCC/include/iostream SYS_INCLUDE=/opt/aCC/include

PROC_src=AlertDBConnectionManager.pc

SRCS = $(PROC_SRC:.pc=.cc)
CC_SRCS = $(SRCS) AlertCollectionManager.cc AlertEntry.cc AlertServer.cc ClientSurveillanceObject.cc EventInterfaceServer.cc
OBJS = $(CC_SRCS:.cc=.o)

IFLAGS = -I$(COLLECTIONAPI) -I$(CONFIGURATIONAPI) -I$(EVENTAPI) -I$(SOCKETAPI)

LD_FLAGS = -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -b

TARGET = AlertServer

$(TARGET) : $(OBJS)
$(CC) $(OBJS) $(CCFLAGS) $(LD_FLAGS) -o $@
chatr +s enable $(TARGET)

.pc.cc:
$(PROC_COMP) $(PROC_FLAGS) $(PROC_INCLUDE) $<

.cc.o: $(CC_SRCS)
$(CC) $(CCFLAGS) $(IFLAGS) -c $< -o $@

clean:
rm -rf $(SRCS) $(OBJS) *.lis


--regards,
soumya