plan44 / vdcd

vdcd - home automation device controller for Digital Strom and (via p44mbrd) matter
https://plan44.ch/automation
Other
22 stars 7 forks source link

Compile Error in external_devices_samples/p44utils_based_C++ #9

Closed alexschabel closed 4 years ago

alexschabel commented 4 years ago

Hello Lukas,

today i pulled the most recent commit of vdcd. When trying to make external_devices_samples/p44utils_based_C++ i get the following error. I am using ubuntu 14.04 LTS

alexschabel@lap-schabel:~/plan44/vdcd/external_devices_samples/p44utils_based_C++$ make
make  all-am
make[1]: Verzeichnis »/home/alexschabel/plan44/vdcd/external_devices_samples/p44utils_based_C++« wird betreten
g++ -DHAVE_CONFIG_H -I.    -I ./src/p44utils -I ./src  -I/usr/include/json-c   -pthread    -g -O2 -MT src/p44utils/p44utilsdevice-application.o -MD -MP -MF src/p44utils/.deps/p44utilsdevice-application.Tpo -c -o src/p44utils/p44utilsdevice-application.o `test -f 'src/p44utils/application.cpp' || echo './'`src/p44utils/application.cpp
In file included from src/p44utils/application.hpp:25:0,
                 from src/p44utils/application.cpp:21:
src/p44utils/p44utils_common.hpp:29:31: fatal error: p44utils_config.hpp: Datei oder Verzeichnis nicht gefunden
 #include "p44utils_config.hpp"
                               ^
compilation terminated.
make[1]: *** [src/p44utils/p44utilsdevice-application.o] Fehler 1
make[1]: Verzeichnis »/home/alexschabel/plan44/vdcd/external_devices_samples/p44utils_based_C++« wird verlassen
make: *** [all] Fehler 2

Thank you for a hint.

Best regards Alex Schabel

plan44 commented 4 years ago

Hi Alex,

On 19 Jan 2020, at 21:38, alexschabel notifications@github.com wrote: Hello Lukas,

today i pulled the most recent commit of vdcd. When trying to make external_devices_samples/p44utils_based_C++ i get the following error.

[...]

src/p44utils/p44utils_common.hpp:29:31: fatal error: p44utils_config.hpp: Datei oder Verzeichnis nicht gefunden

include "p44utils_config.hpp"

Indeed. Sorry for that, oversight on my part & thanks for reporting this.

The problem was: since p44utils commit "9a0c8c1 - p44utils_config.hpp must now exist in project..." p44utils needs a config file in the main project, which I forgot to add to the external device sample.

It should be fixed on the "luz" branch now (but I haven't tried on ubuntu). Hope it works for you!

Lukas

alexschabel commented 4 years ago

Thanks for your quick response.

I had another problem which i simply solved by removing the source file from the Makefile. Think you should have a look at that as well

g++ -I ./src/p44utils -I ./src  -I/usr/include/json-c   -pthread    -g -O2   -o p44utilsdevice src/p44utils/p44utilsdevice-p44obj.o src/p44utils/p44utilsdevice-application.o src/p44utils/p44utilsdevice-consolekey.o src/p44utils/p44utilsdevice-digitalio.o src/p44utils/p44utilsdevice-analogio.o src/p44utils/p44utilsdevice-error.o src/p44utils/p44utilsdevice-gpio.o src/p44utils/p44utilsdevice-i2c.o src/p44utils/p44utilsdevice-spi.o src/p44utils/p44utilsdevice-iopin.o src/p44utils/p44utilsdevice-jsoncomm.o src/p44utils/p44utilsdevice-jsonobject.o src/p44utils/p44utilsdevice-logger.o src/p44utils/p44utilsdevice-mainloop.o src/p44utils/p44utilsdevice-fdcomm.o src/p44utils/p44utilsdevice-socketcomm.o src/p44utils/p44utilsdevice-serialcomm.o src/p44utils/p44utilsdevice-utils.o src/p44utilsdevice-main.o  -ljson-c   -ldl -ljson-c -ldl -lrt -lm
src/p44utils/p44utilsdevice-analogio.o: In Funktion `p44::AnalogIo::AnalogIo(char const*, bool, double)':
/home/alexschabel/plan44/vdcd/external_devices_samples/p44utils_based_C++/src/p44utils/analogio.cpp:131: Nicht definierter Verweis auf `p44::PWMPin::PWMPin(int, int, bool, double, unsigned int)'
collect2: error: ld returned 1 exit status
make[1]: *** [p44utilsdevice] Fehler 1
make[1]: Verzeichnis »/home/alexschabel/plan44/vdcd/external_devices_samples/p44utils_based_C++« wird verlassen
make: *** [all] Fehler 2

Thank you in advance

Alex

plan44 commented 4 years ago

Thanks for reporting, the problem is that analogio.cpp references stuff in pwm.cpp which was not in the makefile. As analogio was not used in the sample, removing it from the makefile as you did was also a viable solution, but I chose to add pwm instead for completeness (on luz branch)