EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20242025  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  <20242025 
<== Date ==> <== Thread ==>

Subject: a compilation error in the aSub processing function.
From: LONG FENG via Tech-talk <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Sat, 2 Nov 2024 15:12:25 +0800
Hi all,
  I encountered the following errors while writing the processing function for the aSub record.

  make -C O.linux-x86_64 -f ../Makefile TOP=../../.. \
    T_A=linux-x86_64 install
make[1]: Entering directory '/home/training/examples/dataProcessingApp/src/O.linux-x86_64'
/usr/bin/g++ -o dataProcessing  -L/home/training/examples/lib/linux-x86_64 -L/ics/tools/StreamDevice-master/lib/linux-x86_64 -L/ics/tools/asyn4-38/lib/linux-x86_64 -L/ics/tools/base-7.0.6/lib/linux-x86_64 -Wl,-rpath,/home/training/examples/lib/linux-x86_64 -Wl,-rpath,/ics/tools/StreamDevice-master/lib/linux-x86_64 -Wl,-rpath,/ics/tools/asyn4-38/lib/linux-x86_64 -Wl,-rpath,/ics/tools/base-7.0.6/lib/linux-x86_64           -rdynamic -m64         dataProcessing_registerRecordDeviceDriver.o dataProcessingMain.o    -ldbRecStd -ldbCore -lca -lCom -lasyn -lstream  
/usr/bin/ld: dataProcessing_registerRecordDeviceDriver.o: in function `dataProcessing_registerRecordDeviceDriver':
/home/training/examples/dataProcessingApp/src/O.linux-x86_64/dataProcessing_registerRecordDeviceDriver.cpp:412: undefined reference to `pvar_func_register_func_dose'
collect2: error: ld returned 1 exit status
make[1]: *** [/ics/tools/base-7.0.6/configure/RULES_BUILD:231: dataProcessing] Error 1
make[1]: Leaving directory '/home/training/examples/dataProcessingApp/src/O.linux-x86_64'
make: *** [/ics/tools/base-7.0.6/configure/RULES_ARCHS:58: install.linux-x86_64] Error 2


  My function(dose.c) content is as follows :
#include <stdint.h>
#include <epicsExport.h>
#include <aSubRecord.h>
#include <registryFunction.h>

int dose(aSubRecord *psub) {
    char *inData;
    double *pout1, doseRate;
    unsigned char readData[4] = {0};
    double *p1, *p2;

    inData = (char *)psub->a;

    pout1 = (double *)psub->vala;
    p1 = (double *)psub->valb;
    p2 = (double *)psub->valc;

    readData[0] = inData[4];
    readData[1] = inData[3];
    readData[2] = inData[6];
    readData[3] = inData[5];

    //Convert to floating point number
    doseRate = *((float*)readData);

    // result
    *pout1 = doseRate;

    return 0;
}
epicsRegisterFunction(dose);

dose.dbd:
function(dose)


Makefile:

TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================

#=============================
# Build the IOC application

PROD_IOC = dataProcessing
# dataProcessing.dbd will be created and installed
DBD += dataProcessing.dbd

# dataProcessing.dbd will be made up from these files:
dataProcessing_DBD += base.dbd
dataProcessing_DBD += dose.dbd

# Build an IOC support library
LIBRARY_IOC += dataProcessingSupport

# Compile and add code to the support library
dataProcessingSupport_SRCS += dose.c

# dataProcessing_registerRecordDeviceDriver.cpp derives from dataProcessing.dbd
dataProcessing_SRCS += dataProcessing_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
dataProcessing_SRCS_DEFAULT += dataProcessingMain.cpp
dataProcessing_SRCS_vxWorks += -nil-

# Add support from base/src/vxWorks if needed
#dataProcessing_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

# Finally link to the EPICS Base libraries
dataProcessing_LIBS += $(EPICS_BASE_IOC_LIBS)

##### ADDED FOR STREAM DEVICE ############
dataProcessing_DBD += stream.dbd
dataProcessing_DBD += asyn.dbd
dataProcessing_DBD += drvAsynSerialPort.dbd

dataProcessing_LIBS += asyn
dataProcessing_LIBS += stream

#===========================
include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE


  Where is the issue, and how should I resolve the error?  

Feng


Replies:
Re: a compilation error in the aSub processing function. Ralph Lange via Tech-talk

Navigate by Date:
Prev: Re: IOC Shell Persist history: ERROR Permission denied (13) writing '.iocsh_history' Michael Davidsaver via Tech-talk
Next: Re: IOC Shell Persist history: ERROR Permission denied (13) writing '.iocsh_history' Ralph Lange via Tech-talk
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  <20242025 
Navigate by Thread:
Prev: Re: IOC Shell Persist history: ERROR Permission denied (13) writing '.iocsh_history' Ralph Lange via Tech-talk
Next: Re: a compilation error in the aSub processing function. Ralph Lange via Tech-talk
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  <20242025 
ANJ, 02 Nov 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·