OpenZWave / open-zwave-control-panel

UNMAINTAINED - We are looking for someone to maintain ozwcp! The OpenZWave Control Panel (ozwcp for short) is an application built on the OpenZWave library that permits users to query, manage and monitor Z-Wave nodes and networks. It provides a web based user interface using AJAX principles.
Other
131 stars 72 forks source link

undefined reference to OpenZWave::Log:.. and OpenZWave::Manager::... and OpenZWave::Options::... #65

Closed ThomasCr closed 7 years ago

ThomasCr commented 7 years ago

Hi, I have installed ubuntu packages from openzwave homepage and the other dependencys.

# dpkg -l|grep -e tinyxml -e openzwave -e libmicrohttpd
ii  libmicrohttpd-dev                           0.9.44+dfsg-1ubuntu2                         amd64        library embedding HTTP server functionality (development)
ii  libmicrohttpd10                             0.9.44+dfsg-1ubuntu2                         amd64        library embedding HTTP server functionality
ii  libopenzwave1.3                             1.4.2639                                     amd64        API to use a Z-Wave controller
ii  libopenzwave1.3-dev                         1.4.2639                                     amd64        header files for the openzwave library
ii  libtinyxml-dev:amd64                        2.6.2-3                                      amd64        TinyXml library - header and static library
ii  libtinyxml2.6.2v5:amd64                     2.6.2-3                                      amd64        C++ XML parsing library
ii  openzwave                                   1.4.2639                                     amd64        Sample Program for libopenzwave

than I fixed the Makefile to Include from /usr/include/openzwave

OPENZWAVE := /usr/include/openzwave
LIBMICROHTTPD := -L/usr/lib/ -lmicrohttpd

INCLUDES := -I $(OPENZWAVE)/ -I $(OPENZWAVE)/command_classes/ \
        -I $(OPENZWAVE)/value_classes/ -I $(OPENZWAVE)/platform/ \
        -I $(OPENZWAVE)/platform/unix/ \
        -I /usr/include/
[...]
ozwcp.o: ozwcp.h webserver.h $(OPENZWAVE)/Options.h $(OPENZWAVE)/Manager.h \
        $(OPENZWAVE)/Node.h $(OPENZWAVE)/Group.h \
        $(OPENZWAVE)/Notification.h $(OPENZWAVE)/platform/Log.h

webserver.o: webserver.h ozwcp.h $(OPENZWAVE)/Options.h $(OPENZWAVE)/Manager.h \
        $(OPENZWAVE)/Node.h $(OPENZWAVE)/Group.h \
        $(OPENZWAVE)/Notification.h $(OPENZWAVE)/platform/Log.h

ozwcp:  ozwcp.o webserver.o zwavelib.o $(LIBZWAVE)
        $(LD) -o $@ $(LDFLAGS) ozwcp.o webserver.o zwavelib.o $(LIBS)

and files are also all there:

# ls -lah /usr/include/openzwave/
insgesamt 312K
drwxr-xr-x  6 root root 4,0K Nov 23 21:11 .
drwxr-xr-x 45 root root 4,0K Nov 25 00:01 ..
drwxr-xr-x  2 root root 4,0K Nov 23 21:11 aes
-rw-r--r--  1 root root 3,5K Jun 23 04:59 Bitfield.h
drwxr-xr-x  2 root root 4,0K Nov 23 21:11 command_classes
-rw-r--r--  1 root root  16K Jun 23 04:59 Defs.h
-rw-r--r--  1 root root 6,5K Jun 23 04:59 DoxygenMain.h
-rw-r--r--  1 root root  40K Jun 23 04:59 Driver.h
-rw-r--r--  1 root root 4,5K Jun 23 04:59 Group.h
-rw-r--r--  1 root root 130K Jun 23 04:59 Manager.h
-rw-r--r--  1 root root 6,5K Jun 23 04:59 Msg.h
-rw-r--r--  1 root root  29K Jun 23 04:59 Node.h
-rw-r--r--  1 root root  11K Jun 23 04:59 Notification.h
-rw-r--r--  1 root root  11K Jun 23 04:59 Options.h
-rw-r--r--  1 root root 3,9K Jun 23 04:59 OZWException.h
drwxr-xr-x  3 root root 4,0K Nov 23 21:11 platform
-rw-r--r--  1 root root 3,2K Jun 23 04:59 Scene.h
-rw-r--r--  1 root root 3,0K Jun 23 04:59 Utils.h
drwxr-xr-x  2 root root 4,0K Nov 23 21:11 value_classes
-rw-r--r--  1 root root  932 Jun 23 04:59 ZWSecurity.h

but when I compile I get a lot of "undefined reference to" in webserver.o

compile.log

Any Idea how to fix this?

ThomasCr commented 7 years ago

when I am not wrong, than I need to add the libs and lib path to LIBS options? Something like -Llibopenzwave -Ltinyxml and -L/usr/lib/x86_64-linux-gnu/ But this also dont work :(

ThomasCr commented 7 years ago

ok, It was my fault.. I copy and pasted the patch from https://github.com/OpenZWave/open-zwave-control-panel/pull/59 and forgot the LIBZWAVE line.. but I also modified LIBS for linux like this:

LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) -lresolv $(shell pkg-config --libs tinyxml libopenzwave)

daradib commented 7 years ago

I think you need to use a patched tinyxml.h instead of the version provided by libtinyxml-dev. I'll comment in #66.