Operating System - HP-UX
1829749 Members
1647 Online
109992 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
Peter Godron
Honored Contributor

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

Soumya,
so this mean it is now working?
The -h option was added to the ld stage of the make. See my pevious mail.
Hope this is the solution.
Regards
soumya das
Advisor

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

Hi peter,

If I add the -h option in the LD_FLAG errors are coming that -h is not recognised there. The same is case for +allowdups.

My prob. is where in my make file can the option -h sqlca or +allowdups be added.

--regards,
soumya
soumya das
Advisor

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

Hi Peter,

Could you find out any solution??

-- regards,

soumya
Peter Godron
Honored Contributor

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

Soumya,
please amend:
LD_FLAGS = -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -b
to
LD_FLAGS = -hsqlca -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -b
and try it (added -hsqlca [no space])
soumya das
Advisor

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

Hi Peter,

I amended as u told .. but the error persists and says "unknown options -hsqlca".

This option works with ld option ie. ld -h sqlca is not giving any error.But not with the LDFLAG options.

Actually it's not recognising the sqlca symbol in the makefile.

Can in any ways the ld option be included in the makefile like ld -h -sqlca be included?? Or we have to put the -h -sqlca in a place where make file will understand the sqlca symbol.
Peter Godron
Honored Contributor

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

Soumya,
we will need a little help from a make expert for this final part. We have written our own scripts for compilation and we separate the process into ProC Pre-compile, C compile and ld steps.

I would suggest you complete this thread with the exisiting solution of adding the -hsqlca and allowdups parameters.

Then open a new thread calling all make experts (include a brief description of the problem and proposed solution).
Many Thanks
soumya das
Advisor

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

Ok, Peter,
Many thanks. I would do what you suggetsed.

--regards,
soumya
soumya das
Advisor

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

Hi,

I think the thread should be completed now.
-h sqlca and +allowdups are some options that can be used with ld.

--regards
soumya