1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | building ioc library - multiple inclusion of Main? |
From: | "David A. Slimmer via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Cc: | "David A. Slimmer" <slimmer at fnal.gov> |
Date: | Mon, 10 Aug 2020 19:00:50 +0000 |
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 |