I’ve been trying to track down the reason for multiple inclusions of the xxxMain.o when I build a library.
The output of the build looks like this:
/usr/bin/ar -rc libaaitest.a devAaiIQM.o aaitest_registerRecordDeviceDriver.o aaitestMain.o aaitestMain.o
Where aaitestMain.o appears twice, and causes a “multiple definition of ‘main’ “ problem.
Here is my App/src/Makefile:
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
# Build an IOC support library
LIBRARY_IOC += aaitest
DBD += aaiIQM.dbd
aaitest_SRCS += devAaiIQM.cpp
aaitest_LIBS += $(EPICS_BASE_IOC_LIBS)
# additional compile flags for adinstbpm code called in device support
USR_CXXFLAGS += -g
USR_CXXFLAGS += -DNETCOMMS_TRANSPORT=UDP
USR_CXXFLAGS += -fPIC
USR_INCLUDES += -I/home/rsantucc/adinstbpm
USR_INCLUDES += -I/usr/local/products/erlang-apps/cdev-1.3/include
USR_INCLUDES += -I/usr/local/products/erlang-apps/acnet-2.2/include
USR_INCLUDES += -I/usr/local/products/include/shared/ddcp
USR_INCLUDES += -I/usr/local/products/include
USR_INCLUDES += -I/usr/local/products/trace/include/TRACE
USR_LDFLAGS += -lbpmclientlib
USR_LDFLAGS += -lbbpm250x12
USR_LDFLAGS += -lbtime
USR_LDFLAGS += -liotatime
USR_LDFLAGS += -lddcp
USR_LDFLAGS += -lconfig++
USR_LDFLAGS += -lnl-genl-3
USR_LDFLAGS += -lnl-3
USR_LDFLAGS += -lrt
#=============================
# Build the IOC application
PROD_IOC = aaitest
# aaitest.dbd will be created and installed
DBD += aaitest.dbd
# aaitest.dbd will be made up from these files:
aaitest_DBD += base.dbd
aaitest_DBD += aaiIQM.dbd
# Include dbd files from all support applications:
#aaitest_DBD += xxx.dbd
# Add all the support libraries needed by this IOC
#aaitest_LIBS +=
# aaitest_registerRecordDeviceDriver.cpp derives from aaitest.dbd
aaitest_SRCS += aaitest_registerRecordDeviceDriver.cpp
# Build the main IOC entry point on workstation OSs.
aaitest_SRCS_DEFAULT += aaitestMain.cpp
aaitest_SRCS_vxWorks += -nil-
# Add support from base/src/vxWorks if needed
#aaitest_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
# Finally link to the EPICS Base libraries
aaitest_LIBS += $(EPICS_BASE_IOC_LIBS)
#===========================
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE
Any ideas would be appreciated –
Thanks,
Dave