Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ThomasCr opened this issue Nov 25, 2017 · 3 comments

Comments

@ThomasCr
Copy link

ThomasCr commented Nov 25, 2017

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
Copy link
Author

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
Copy link
Author

ok, It was my fault.. I copy and pasted the patch from #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
Copy link

daradib commented Nov 25, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants