1753797 Members
7294 Online
108799 Solutions
New Discussion юеВ

The ld option -b

 
soumya das
Advisor

The ld option -b

Hi all,

Can I use -b option with the LD option if I want to make an executable file ie. if my target is an executable file. My makefile code is like this :

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

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

#-L$(CONFIGURATIONAPI) -L$(COLLECTIONAPI) -L$(EVENTAPI) -L$(SOCKETAPI) -L$(MQAPI) -lconfigurationmanager -lcollectionmanager -leventmanager -lsocketlib

TARGET = AlertServer

$(TARGET) : $(OBJS)
$(CC) $(CCFLAGS) $(LD_FLAGS) $(OBJS) -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

can it make the shared executable AlertServer. In my case it's not making an execuatble , instead it is making a shared library file.

and if I don't use the -b option the errors are like this :

/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)
AlertDBConnectionManager::getAlertDescription(char *,char *) (first referenced in EventInterfaceServer.o) (code)
Logger::~Logger() (first referenced in EventInterfaceServer.o) (code)
RWCollectable::compareTo(const RWCollectable *) const (first referenced in AlertEntry.o) (code)
Logger::Logger() (first referenced in EventInterfaceServer.o) (code)
Logger::logMessage(int,char *,...) (first referenced in EventInterfaceServer.o) (code)
Logger::initialize(char *,char *) (first referenced in EventInterfaceServer.o) (code)
ConfigurationFileManager::getFieldValue(char *) (first referenced in EventInterfaceServer.o) (code)
RWCollectable::~RWCollectable() (first referenced in AlertCollectionManager.o) (code)
typeid (first referenced in AlertEntry.o) (data)
RWCollectable::copy() const (first referenced in AlertEntry.o) (code)
RWCollectable::isEqual(const RWCollectable *) const (first referenced in AlertEntry.o) (code)
AlertDBConnectionManager::~AlertDBConnectionManager() (first referenced in EventInterfaceServer.o) (code)
AlertDBConnectionManager::initialize() (first referenced in EventInterfaceServer.o) (code)
AlertDBConnectionManager::updateAdminAlertsToDb(char *,char *) (first referenced in EventInterfaceServer.o) (code)
ConfigurationFileManager::~ConfigurationFileManager() (first referenced in EventInterfaceServer.o) (code)
RWCollectable::newSpecies() const (first referenced in AlertEntry.o) (code)
RWCollectable::binaryStoreSize() const (first referenced in AlertEntry.o) (code)
ConfigurationFileManager::ConfigurationFileManager()%1 (first referenced in EventInterfaceServer.o) (code)
Class tables [Vtable] dependent on key function: "RWCollectableString::newSpecies() const" (first referenced in AlertCollectionM)
RWCollectable::saveGuts(RWvostream &) const (first referenced in AlertEntry.o) (code)
RWCString::RWCString(const char *)%2 (first referenced in AlertCollectionManager.o) (code)
RWCollectable::isA() const (first referenced in AlertEntry.o) (code)
*** Error exit code 1


Can anyone suggest any solution.
9 REPLIES 9
Stephen Keane
Honored Contributor

Re: The ld option -b

The -b flag creates a shared library, not an executable, is that what you are trying to do? If so you need either +z or +Z as well.
Stephen Keane
Honored Contributor

Re: The ld option -b

I have assigned points to 0 of 14 responses to my questions.

So don't forget to assign points if your problem is solved!
soumya das
Advisor

Re: The ld option -b

Hi Stephen,

Yes I want to creat an execuatble file AlertServer. Should I use +z/+Z along with the -b option or only +z/+Z in the LD Flag.

If I don't use the -b option then the errors /usr/ccs/bin/ld: Unsatisfied symbols:

are coming.

-regards
soumya
soumya das
Advisor

Re: The ld option -b


Hi Stephen,
But last time I assigned almost max pts. to ur ans.

--regards,
soumya
Stephen Keane
Honored Contributor

Re: The ld option -b

Yes you need '-b and +z' or '-b and +Z' to create a shared library.

Possibly you are getting closing a thread and assigning points confused?

Your profile still shows 0 points in 15 responses.

I would start with -b +z, if you still get errors, try -b +Z
soumya das
Advisor

Re: The ld option -b

Hi Stephen,

This time I think I have assigned pts.

I used -b +z and the errors are not comin since I used -b. But will creat an Executable file??

--regards,

soumya
soumya das
Advisor

Re: The ld option -b

Hi,

I don't want to create a shared library , but a shared executeable file.

Should I use -b with +z?

-regards,
soumya
Stephen Keane
Honored Contributor

Re: The ld option -b

You only need the -b/+z flags if you want a shared executable library. I don't understand what you mean by a shared executable file.

You haven't assigned any points, are you clicking on the 'assign points' button, after selecting the number of points you wish to assign next to a post?
Stephen Keane
Honored Contributor

Re: The ld option -b

OK, I think I see what you are trying to do. You don't need either the -b or the +z flags. I see you have started another thread which deals with the unsatisfied symbols issue you are having. I also see that you are assigning points as well :)

I'll see you over in your other thread.