(please, do not write to me only. The more people see this, the more chances to get the needed answer. E-mail of the list restored.)
19.08.2017 22:36, bruce пишет: > On 08/19/2017 00:14, Boris Samorodov wrote: >> Hi Bruce, All! >> >> 19.08.2017 01:03, bruce пишет: >>> Hi, >>> >>> I am trying to get a program to compile on freebsd-11.1. It compiles >>> just fine using ubuntu-16.04 but there is a problem with linking >>> libserialport with freebsd. Below are the configure.ac and Makefile.am >>> I am using. The linker error follows. Can anyone help? >>> >>> linker error: >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_close' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_be_free' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_kernel_driver_active' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_req_string_simple_sync' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_get_address' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_get_iface_desc' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_be_device_foreach' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_get_bus_number' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_be_alloc_default' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_get_desc' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_get_device_desc' >>> /usr/local/lib/libserialport.so: undefined reference to >>> `libusb20_dev_open' >>> c++: error: linker command failed with exit code 1 (use -v to see >>> invocation) >>> *** Error code 1 >>> >>> Stop. >>> >>> >>> >>> Makefile.am: >>> >>> gardendir = /home/blm/garden/src >>> garden_DATA = ../data/state_table >>> AUTOMAKE_OPTIONS = subdir-objects >>> ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} >>> cc=c++ >>> bin_PROGRAMS = garden >>> garden_SOURCES = main.cpp garden.cpp >>> garden_CPPFLAGS = $(GTKMM_CFLAGS) >>> garden_CPPFLAGS += -std=c++11 >>> garden_LDFLAGS = $(GTKMM_LIBS) >>> garden_CXXFLAGS = $(DEPS_CFLAGS) >>> garden_LDADD = $(DEPS_LIBS) >>> >>> configure.ac: >>> >>> AC_PREREQ([2.69]) >>> AC_INIT([FULL-PACKAGE-NAME],[VERSION],[BUG-REPORT-ADDRESS]) >>> AM_INIT_AUTOMAKE >>> PKG_CHECK_MODULES([DEPS], [gtkmm-3.0 >= 3.0.0]) >>> PKG_CHECK_MODULES([DEPS], [libserialport-0.1.0 >= 0.1.0]) >>> AC_CONFIG_SRCDIR([src/garden.cpp]) >>> AC_CONFIG_HEADERS([config.h]) >>> >>> # Checks for programs. >>> AC_PROG_CXX >>> AC_PROG_CC >>> >>> # Checks for libraries. >>> AC_ARG_WITH([libserialport-include-path], >>> [AS_HELP_STRING([--with-libserialport-include-path], >>> [location of the libserialport headers, defaults to >>> /usr/local/include])], >>> [A_CFLAGS="-I$withval"], >>> [A_CFLAGS='-I/usr/local/include']) >>> AC_SUBST([A_CFLAGS]) >>> >>> AC_ARG_WITH([libserialport-lib-path], >>> [AS_HELP_STRING([--with-libserialport-lib-path], [location of >>> the libserialport libraries])], >>> [LIBS="-L/usr/local/lib"], >>> [LIBS='-lserialport']) >>> AC_SUBST([LIBS]) >>> # Checks for header files. >>> AC_CHECK_HEADERS([unistd.h]) >>> # Checks for typedefs, structures, and compiler characteristics. >>> AC_HEADER_STDBOOL >>> >>> # Checks for library functions. >>> >>> AC_CONFIG_FILES([Makefile >>> src/Makefile]) >>> AC_OUTPUT >> Probably you should use '-lusb' linking flag at FreeBSD. Take a look at >> /usr/libdata/pkgconfig/libusb-2.0.pc. >> >> Hm, libserialport.pc does not mention this. Should it (at FreeBSD)? >> > Thanks for your help. I used -lusb and I get the following: > > mv -f .deps/garden-garden.Tpo .deps/garden-garden.Po > c++ -I/usr/local/include/gtkmm-3.0 -I/usr/local/lib/gtkmm-3.0/include > -I/usr/local/include/atkmm-1.6 -I/usr/local/include/atk-1.0 > -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include > -I/usr/local/include -I/usr/local/include/glibmm-2.4 > -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/sigc++-2.0 > -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include/giomm-2.4 > -I/usr/local/lib/giomm-2.4/include -I/usr/local/include/pangomm-1.4 > -I/usr/local/lib/pangomm-1.4/include -I/usr/local/include/cairomm-1.0 > -I/usr/local/lib/cairomm-1.0/include -I/usr/local/include/cairo > -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 > -I/usr/local/include/libdrm -I/usr/local/include/libpng16 > -I/usr/local/include/pango-1.0 -I/usr/local/include/harfbuzz > -I/usr/local/include/gtk-3.0 -I/usr/local/include/gdk-pixbuf-2.0 > -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/at-spi2-atk/2.0 > -I/usr/local/include/at-spi-2.0 -I/usr/local/include/dbus-1.0 > -I/usr/local/lib/dbus-1.0/include > -I/usr/local/include/gtk-3.0/unix-print -I/usr/local/include/gdkmm-3.0 > -I/usr/local/lib/gdkmm-3.0/include -D_THREAD_SAFE -pthread -g -O2 -o > garden garden-main.o garden-garden.o -L/usr/local/lib -lgtkmm-3.0 > -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 > -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 > -lcairomm-1.0 -lcairo -lpthread -lsigc-2.0 -lgdk_pixbuf-2.0 > -lgobject-2.0 -lglib-2.0 -lintl -lusb > garden-garden.o: In function `Garden::on_button21_clicked()': > /usr/home/blm/garden/src/garden.cpp:723: undefined reference to `sp_close' > garden-garden.o: In function `Garden::~Garden()': > /usr/home/blm/garden/src/garden.cpp:247: undefined reference to `sp_close' > /usr/home/blm/garden/src/garden.cpp:248: undefined reference to > `sp_free_port' > garden-garden.o: In function `Garden::opp_valves(Glib::ustring, > Glib::ustring, Gtk::Image&, Glib::ustring, char*)': > /usr/home/blm/garden/src/garden.cpp:874: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:878: undefined reference to > `sp_nonblocking_read' > garden-garden.o: In function `Garden::on_button2_clicked()': > /usr/home/blm/garden/src/garden.cpp:337: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:341: undefined reference to > `sp_nonblocking_read' > /usr/home/blm/garden/src/garden.cpp:311: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:315: undefined reference to > `sp_nonblocking_read' > garden-garden.o: In function `Garden::on_button4_clicked()': > /usr/home/blm/garden/src/garden.cpp:443: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:447: undefined reference to > `sp_nonblocking_read' > /usr/home/blm/garden/src/garden.cpp:416: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:420: undefined reference to > `sp_nonblocking_read' > garden-garden.o: In function `Garden::on_button6_clicked()': > /usr/home/blm/garden/src/garden.cpp:547: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:551: undefined reference to > `sp_nonblocking_read' > /usr/home/blm/garden/src/garden.cpp:521: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:525: undefined reference to > `sp_nonblocking_read' > garden-garden.o: In function `Garden::on_button8_clicked()': > /usr/home/blm/garden/src/garden.cpp:651: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:655: undefined reference to > `sp_nonblocking_read' > /usr/home/blm/garden/src/garden.cpp:625: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:629: undefined reference to > `sp_nonblocking_read' > garden-garden.o: In function `Garden::open_weeder_port(sp_mode, > Glib::ustring)': > /usr/home/blm/garden/src/garden.cpp:826: undefined reference to > `sp_get_port_by_name' > /usr/home/blm/garden/src/garden.cpp:827: undefined reference to `sp_open' > /usr/home/blm/garden/src/garden.cpp:830: undefined reference to > `sp_new_config' > /usr/home/blm/garden/src/garden.cpp:831: undefined reference to > `sp_set_config_baudrate' > /usr/home/blm/garden/src/garden.cpp:832: undefined reference to > `sp_set_config_bits' > /usr/home/blm/garden/src/garden.cpp:833: undefined reference to > `sp_set_config_parity' > /usr/home/blm/garden/src/garden.cpp:834: undefined reference to > `sp_set_config_stopbits' > /usr/home/blm/garden/src/garden.cpp:835: undefined reference to > `sp_set_config_flowcontrol' > /usr/home/blm/garden/src/garden.cpp:836: undefined reference to > `sp_set_config' > /usr/home/blm/garden/src/garden.cpp:837: undefined reference to > `sp_free_config' > /usr/home/blm/garden/src/garden.cpp:838: undefined reference to `sp_flush' > garden-garden.o: In function `Garden::init_weeder()': > /usr/home/blm/garden/src/garden.cpp:851: undefined reference to > `sp_nonblocking_write' > /usr/home/blm/garden/src/garden.cpp:855: undefined reference to > `sp_nonblocking_read' > /usr/home/blm/garden/src/garden.cpp:857: undefined reference to `sp_flush' > c++: error: linker command failed with exit code 1 (use -v to see > invocation) > *** Error code 1 OK. That seems to be a libserial interface. So you lack a "-lserialport" linking flag. HTH -- WBR, bsam ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel