Operating System - HP-UX
1833771 Members
2317 Online
110063 Solutions
New Discussion

/usr/ccs/bin/ld: Unsatisfied Symbols

 
SOLVED
Go to solution
soumya das
Advisor

/usr/ccs/bin/ld: Unsatisfied Symbols

This is the error I am getting while running a makefile to create an executable file.


/usr/ccs/bin/ld: Unsatisfied symbols:
RWCollectable::RWCollectable()%2 (first referenced in AlertCollectionManager.o) (code)
RWCollectable::saveGuts(RWFile &) const (first referenced in AlertEntry.o) (code)
ConfigurationFileManager::initialize(char *,char *) (first referenced in EventInterfaceServer.o) (code)
RWCollectable::hash() const (first referenced in AlertEntry.o) (code)
RWCollectable::restoreGuts(RWFile &) (first referenced in AlertEntry.o) (code)
AlertDBConnectionManager::enableUserSubscribedAlerts(AlertCollectionManager *,char *) (first referenced in EventInterfaceServer.)
AlertDBConnectionManager::AlertDBConnectionManager(char *,char *,char *) (first referenced in EventInterfaceServer.o) (code)
RWCollectable::restoreGuts(RWvistream &) (first referenced in AlertEntry.o) (code)


I have checked withn the corresponding header files where the definitions of these functions exist. So, all the functions for which "Unsatisfied Error" is coming are defined .. still the error is occuring .

Can anyone help?

--regards
soumya
22 REPLIES 22
A. Clay Stephenson
Acclaimed Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

This has nothing to do with header files; you need to add libraries and/or object files to your make definitions. Ld is the linker.
If it ain't broke, I can fix that.
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hello again,

it looks like you need to link in some RogueWave? libraries. You have included the header files, but also ned to link in the corresponding library or libraries.
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi stephen,

I have included the libraries as well as the object (.o) files in th LD Flag option.

One of the make file is running fine.

But the other one is giving some warning like :

aCC: warning 901: unknown option: `-AlertDBConnectionManager.o': use +help for online documentation.

There are as many warning as there are object files included with the LD Flag options.
Can u suggest anything ?

I am attatching the output of running the makefile.

Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

It looks like the makefile is wrong. It is prefixing the name of the object file with a '-', which the compiler thinks is a flag, so instead of including (for example) AlertDBConnectionManager.o in the link stage, it is treating it as -A (flag) -l(flag) etc, which makes no sense.

Can you post the makefile itself?
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi Stephen,

The makefile for alertserver is the following:

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

LD_FLAGS = -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -L$(SVLMESSAGEHANDLERAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -lmqapi -lsvlmessagehandler -limqi23ah -lmqm -lmqic -SvlInputMessageHandler.o -AlertDBConnectionManager.o -AlertCollectionManager.o -AlertEntry.o -AlertServer.o -ClientSurveillanceObject.o -EventInterfaceServer.o +z
IFLAGS = -I$(COLLECTIONAPI) -I$(CONFIGURATIONAPI) -I$(EVENTAPI) -I$(SOCKETAPI)

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)

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






The makefile for Svlmessagehandler is :

include ../../Include_Paths

CC = /opt/softbench/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
LD_FLAGS = -B immediate -B nonfatal -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -L$(SVLMESSAGEHANDLERAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -lmqapi -lsvlmessagehandler -limqi23ah -lmqm -lmqic -InputMqHandler.o -SvlAlertGeneration.o -SvlHandlerMain.o -SvlInputMessageHandler.o -SvlInterfaceServer.o -Wl,-hsqlca,+allowdups +z

PROC_src=SvlAlertGeneration.pc

SRCS = $(PROC_SRC:.pc=.cc)
CC_SRCS = $(SRCS) InputMqHandler.cc SvlInputMessageHandler.cc SvlHandlerMain.cc SvlInterfaceServer.cc
OBJS = $(CC_SRCS:.cc=.o)

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

TARGET = SvlInputMessageHandler

$(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 $(OBJS) $(SRCS) *.lis


While the latter is not throwing any warning the formaer one (for alertserver) warnings are coming -- aCC: warning 901: unknown option: `-AlertDBConnectionManager.o': use +help for online documentatio
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

I think the LDFLAGS in the first makefile should read

LD_FLAGS = -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -L$(SVLMESSAGEHANDLERAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -lmqapi -lsvlmessagehandler -limqi23ah -lmqm -lmqic SvlInputMessageHandler.o AlertDBConnectionManager.o AlertCollectionManager.o AlertEntry.o AlertServer.o ClientSurveillanceObject.o EventInterfaceServer.o +z
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

I think the LDFLAGS in the second makefile should read

LD_FLAGS = -B immediate -B nonfatal -L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -L$(SVLMESSAGEHANDLERAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib -lmqapi -lsvlmessagehandler -limqi23ah -lmqm -lmqic InputMqHandler.o SvlAlertGeneration.o SvlHandlerMain.o SvlInputMessageHandler.o SvlInterfaceServer.o -Wl,-hsqlca,+allowdups +z
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi,
I tried as u told .. but errors like "Duplicate Symbols" are coming up.

/usr/ccs/bin/ld: Duplicate symbol "AlertDBConnectionManager::AlertDBConnectionManager(char *,char *,char *)" in files AlertDBConnectionManager.o and AlertDBConnectionManager.o

I think this is because the library files also include the same object files.

And If I don't include those object files then the following errors are coming up:

/usr/ccs/bin/ld: Unsatisfied symbols:
RWCollectable::RWCollectable()%2 (first referenced in AlertDBConnectionManager.o) (code)
typeid (first referenced in SvlInputMessageHandler.o) (data)
RWCollectable::saveGuts(RWFile &) const (first referenced in AlertEntry.o) (code)

--regards,

soumya
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

OK, don't include the object files, as you say the libraries already contain the same things. What we need to find is where the constructor for the RWCollectable() class is defined.

Are you including the header file that declares the constructor?

Do you know which library it is defined in?

soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

In the proc file the header files like collect.h and collstr.h have been included which contains the definitions of RWCollectable class. I have also included the library files which contains the objectfiles of the .pc files.

I don't understand why this "Unstisfied symbol" error is coming up.
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Are you sure that the variables

CONFIGURATIONAPI
COLLECTIONAPI
EVENTAPI
SOCKETAPI
MQAPI
SVLMESSAGEHANDLERAPI

etc. are set properly?
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Does you makefile really say

PROC_FLAGS = CODE=CPP CPP_SUFFIX=cc

Or is that a formatting error introduced by the posting process, it should read

PROC_FLAGS=
CODE=CPP
CPP_SUFFIX=cc




Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

and you don't need the +Z flag in your makefile either.
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi Stephen,

The paths are rightly set .. but I could not check the value of those variables like
CONFIGURATIONAPI,COLLECTIONAPI,EVENTAPI, by echo $CONFIGURATIONAPI.

But PROC_FLAGS = CODE=CPP CPP_SUFFIX=cc

is correct ,otherwise syntax errors are coming.
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Have you removed the +Z flag from the makefile yet?

soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi,

Now I'm getting the error :

/usr/ccs/bin/ld: Unsatisfied symbols:
sqlcxt (first referenced in SvlAlertGeneration.o) (code)

I think it is because of some library files that is getting missed ..

Can anyone suggest which library file should I use?
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

I think it is in libclntsh.so

So your makefile (LD_FLAGS) would need to include:

-L $(ORACLE_HOME)/lib -lclntsh
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi Stephen,

Thanks for the ans. Although I could find it out from other sources.

I 'm not able to give u points since that portion is disables and showing the "unassigned". That drop down list is not there.


--regards
soumya
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi,

I am now getting a differnt set of probs. while running the Alertserver and Inputmessagehandler(executables generated after running the makefile.).The errors in the nohup.out is the following:

error opening specified file errno = 2
Error in initializing Logger
InterfaceServer failed to initialize

Can u throw any light on this?

-regards,
soumya
Stephen Keane
Honored Contributor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

The error number (2) indicates that a file can not be found. I don't know enough about the application you are trying to run to tell you which file it can't find, but I suspect it is one of the arguments you supply when running the application, or the configuration file used by the application.
soumya das
Advisor

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Hi,

Thanks for the answers. My Unsatisfied symbols problems are solved after including required oracle libraries.

Right now I'm facing another problem. It is coming in the entry of nohup.out.It says:


1) Logger not initialised
2) Interface Server not initialised.
3)"specified key does not have a section in the configuration file"

There are two config files --
AlertConfig.cfg and SvlInputMessageHandler.cfg

The parameters in these two files are being accessed.

Can u throw any light where is the actual problem??

Peter Godron
Honored Contributor
Solution

Re: /usr/ccs/bin/ld: Unsatisfied Symbols

Soumya,
hello again!

The messages in the nohup.out file are coming from the application itself.

Congratulations on getting the code compiled and linked.

I suggest you review the code and/or grep the files for the messages to get an idea where the problem is.

Regards