jpoet / HauppaugeUSB

MythTV wrapper around the Hauppauge HD-PVR2/Colossus2 driver
GNU General Public License v3.0
16 stars 5 forks source link

Compile error #1

Closed rajil closed 6 years ago

rajil commented 6 years ago

I tried to compile it on Gentoo which uses openrc and got this error:

g++ -g -c -Wall -std=c++11 -fdiagnostics-color -DBOOST_LOG_DYN_LINK -pthread -m64 -g -O3 -D_GNU_SOURCE -DDRIVER_BUILD -DHAUPPAUGE -DHCW_E5BDA `pkg-config --cflags libusb-1.0` -I.. -I./Hauppauge/Common -I./Wrappers/linux -I./Hauppauge/Common/FX2API -I./Hauppauge/Common/Rx/ADV7842 -I./Hauppauge/Common/Rx/ADV7842/RX -I./Hauppauge/Common/Rx/ADV7842/RX/LIB -I./Hauppauge/Common/Rx/ADV7842/RX/HAL -I./Hauppauge/Common/Rx/ADV7842/RX/HAL/4G -I./Hauppauge/Common/Rx/ADV7842/RX/HAL/4G/ADV7842/HAL -I./Hauppauge/Common/Rx/ADV7842/RX/HAL/4G/ADV7842/MACROS -I./Hauppauge/Common/Rx -I./Hauppauge/Common/EncoderDev -I./Hauppauge/Common/EncoderDev/HAPIHost -I./Hauppauge/Common/EncoderDev/HAPIHost/MChip `pkg-config --cflags libusb-1.0` Logger.cpp -o Logger.o
Logger.cpp:25:32: fatal error: systemd/sd-journal.h: No such file or directory
 #include <systemd/sd-journal.h>
                                ^
compilation terminated.
make: *** [Makefile:61: Logger.o] Error 1
jpoet commented 6 years ago

Did you try commenting out the "#define CONFIG_SYSTEMD_JOURNAL 0" line? Add a couple of slashes // to the front of it.

rajil commented 6 years ago

After commenting out in Logger.cpp, like so //#define CONFIG_SYSTEMD_JOURNAL 1

I got this,

g++ -g -c -Wall -std=c++11 -fdiagnostics-color -DBOOST_LOG_DYN_LINK -pthread -m64 -g -O3 -D_GNU_SOURCE -DDRIVER_BUILD -DHAUPPAUGE -DHCW_E5BDA `pkg-config --cflags libusb-1.0` -I.. -I./Hauppauge/Common -I./Wrappers/linux -I./Hauppauge/Common/FX2API -I./Hauppauge/Common/Rx/ADV7842 -I./Hauppauge/Common/Rx/ADV7842/RX -I./Hauppauge/Common/Rx/ADV7842/RX/LIB -I./Hauppauge/Common/Rx/ADV7842/RX/HAL -I./Hauppauge/Common/Rx/ADV7842/RX/HAL/4G -I./Hauppauge/Common/Rx/ADV7842/RX/HAL/4G/ADV7842/HAL -I./Hauppauge/Common/Rx/ADV7842/RX/HAL/4G/ADV7842/MACROS -I./Hauppauge/Common/Rx -I./Hauppauge/Common/EncoderDev -I./Hauppauge/Common/EncoderDev/HAPIHost -I./Hauppauge/Common/EncoderDev/HAPIHost/MChip `pkg-config --cflags libusb-1.0` hauppauge2.cpp -o hauppauge2.o
g++ Logger.o Common.o MythTV.o HauppaugeDev.o hauppauge2.o -o hauppauge2  `pkg-config --libs libusb-1.0` `pkg-config --libs libsystemd` -lpthread libADV7842.a -lboost_program_options -lboost_log -lboost_log_setup -lboost_system -lboost_thread -lboost_filesystem
Package libsystemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd' found

Does this work without systemd?

jpoet commented 6 years ago

I have not tested it without systemd, but I think it should work.

To get it past your latest issue, you will need to edit Makefile. Look for the line " pkg-config --libs libsystemd \" and delete it. That section should end up looking like:

REC_LDFLAGS  += `pkg-config --libs libusb-1.0` \
            -lpthread

That should allow it to build.

jpoet commented 6 years ago

I have pushed a change which removes the attempt to use systemd. Please let me know if this fixes the issue.

rajil commented 6 years ago

It compiles fine now, g++ Logger.o Common.o MythTV.o HauppaugeDev.o hauppauge2.o -o hauppauge2pkg-config --libs libusb-1.0-lpthread libADV7842.a -lboost_program_options -lboost_log -lboost_log_setup -lboost_system -lboost_thread -lboost_filesystem