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  <20172018  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  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Problem compiling EPICS ioc with libusb
From: Mark Rivers <[email protected]>
To: 'Sam de Jong' <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 22 Jun 2017 23:21:07 +0000

You need to add libusb to testApp/src/Makefile like this:

 

test_SYS_LIBS += usb

 

Mark

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Sam de Jong
Sent: Thursday, June 22, 2017 6:17 PM
To: [email protected]
Subject: Problem compiling EPICS ioc with libusb

 

Hello EPICS tech-talk,

    I am trying to compile an EPICS IOC with libusb included (I am on a linux platform running ubuntu 14.04 and EPICS base 3.14-3.14.12.3 ).

    I created the ioc using

    makeBaseApp.pl -t example test   
    makeBaseApp.pl -t example -i -a linux-x86_64 test

and was able to run make with no issues.

I added the header files for a class I created which interfaces with a usb device (these are included in this email) by adding this line to /testAPP/src/testMain.cpp:

    #include "DI-2108-P.cpp"

when I try to make, I get this output:

make -C ./configure install
make[1]: Entering directory `/media/Extra_Space/work/testIOC/configure'
make -C O.linux-x86_64 -f ../Makefile TOP=../.. T_A=linux-x86_64 install
make[2]: Entering directory `/media/Extra_Space/work/testIOC/configure/O.linux-x86_64'
perl ../../../epics/epics3.14-3.14.12.3/bin/linux-x86_64/convertRelease.pl checkRelease
make[2]: Leaving directory `/media/Extra_Space/work/testIOC/configure/O.linux-x86_64'
make[1]: Leaving directory `/media/Extra_Space/work/testIOC/configure'
make -C ./testApp install
make[1]: Entering directory `/media/Extra_Space/work/testIOC/testApp'
make -C ./src install
make[2]: Entering directory `/media/Extra_Space/work/testIOC/testApp/src'
make -C O.linux-x86_64 -f ../Makefile TOP=../../.. T_A=linux-x86_64 install
make[3]: Entering directory `/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64'

/usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500           -D_X86_64_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -O3 -g   -Wall      -m64      -MMD -I. -I../O.Common -I. -I.. -I../../../include/os/Linux -I../../../include -I../../../../epics/epics3.14-3.14.12.3/include/os/Linux -I../../../../epics/epics3.14-3.14.12.3/include       ../testMain.cpp
In file included from ../testMain.cpp:14:0:
../DI-2108-P.cpp: In member function ‘std::vector<double> DI_2108_P::getReadings()’:
../DI-2108-P.cpp:202:7: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
   int r; //for return values
       ^
/usr/bin/g++ -o test  -L/media/Extra_Space/work/epics/epics3.14-3.14.12.3/lib/linux-x86_64 -L/media/Extra_Space/work/testIOC/lib/linux-x86_64        -m64              test_registerRecordDeviceDriver.o testMain.o    -ltestSupport -lrecIoc -lsoftDevIoc -lmiscIoc -lrsrvIoc -ldbtoolsIoc -lasIoc -ldbIoc -lregistryIoc -ldbStaticIoc -lca -lCom  
testMain.o: In function `DI_2108_P::Initialize()':
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:37: undefined reference to `libusb_init'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:42: undefined reference to `libusb_set_debug'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:44: undefined reference to `libusb_get_device_list'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:51: undefined reference to `libusb_open_device_with_vid_pid'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:56: undefined reference to `libusb_free_device_list'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:58: undefined reference to `libusb_kernel_driver_active'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:63: undefined reference to `libusb_claim_interface'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:60: undefined reference to `libusb_detach_kernel_driver'
testMain.o: In function `DI_2108_P::close()':
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:82: undefined reference to `libusb_release_interface'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:89: undefined reference to `libusb_close'
testMain.o: In function `DI_2108_P::sendMessage(std::string)':
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:114: undefined reference to `libusb_bulk_transfer'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:118: undefined reference to `libusb_bulk_transfer'
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:120: undefined reference to `libusb_strerror'
testMain.o: In function `DI_2108_P::getReadings()':
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:208: undefined reference to `libusb_bulk_transfer'
testMain.o: In function `DI_2108_P::reset()':
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:74: undefined reference to `libusb_reset_device'
testMain.o: In function `DI_2108_P::close()':
/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64/../DI-2108-P.cpp:90: undefined reference to `libusb_exit'
collect2: error: ld returned 1 exit status
make[3]: *** [test] Error 1
make[3]: Leaving directory `/media/Extra_Space/work/testIOC/testApp/src/O.linux-x86_64'
make[2]: *** [install.linux-x86_64] Error 2
make[2]: Leaving directory `/media/Extra_Space/work/testIOC/testApp/src'
make[1]: *** [src.install] Error 2
make[1]: Leaving directory `/media/Extra_Space/work/testIOC/testApp'
make: *** [testApp.install] Error 2

 

Do you have any idea what might be causing this issue? I've tried googling around and haven't found anything helpful.

Thank you for your assistance,
-Sam de Jong

   

   


Replies:
Re: Problem compiling EPICS ioc with libusb Michael Westfall
Re: Problem compiling EPICS ioc with libusb Hinko Kocevar
References:
Problem compiling EPICS ioc with libusb Sam de Jong

Navigate by Date:
Prev: Problem compiling EPICS ioc with libusb Sam de Jong
Next: Re: Problem compiling EPICS ioc with libusb Michael Westfall
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Problem compiling EPICS ioc with libusb Sam de Jong
Next: Re: Problem compiling EPICS ioc with libusb Michael Westfall
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·