Open adiel91 opened 2 years ago
Hi, the problem for this might be the inline function definition of print_get_level. Solutions are to either change the function in the print.h and print.c files to a normal non-inline function: print.h:
-- inline int print_get_level(void)
-- {
-- return print_level;
-- }
++ int print_get_level(void);
print.c:
++ int print_get_level(void)
++ {
++ return print_level;
++ }
or set some optimization options for the compiler by adding EXTRA_CFLAGS = -O2
to the makefile.
Trying to compile latest ptp4l (17.02.2022) from git, fails. Head commit ID: 1614aefad3284ba67ea5eb64271e882ad57c2b5a
Compilation: make -j$(nproc)
System: Debian 9 Stretch, GCC 6.3.0
Failures: gcc ts2phc.o config.o clockadj.o hash.o interface.o phc.o print.o linreg.o ntpshm.o nullf.o pi.o servo.o sk.o lstab.o nmea.o serial.o sock.o ts2phc_generic_master.o ts2phc_master.o ts2phc_phc_master.o ts2phc_nmea_master.o ts2phc_slave.o util.o version.o -lm -lrt -pthread -o ts2phc phc2sys.o: In function
servo_add': phc2sys.c:(.text+0x105): undefined reference to
print_get_level' phc2sys.c:(.text+0x16e): undefined reference toprint_get_level' phc2sys.o: In function
clock_add': phc2sys.c:(.text+0x21d): undefined reference toprint_get_level' phc2sys.c:(.text+0x326): undefined reference to
print_get_level' phc2sys.c:(.text+0x387): undefined reference toprint_get_level' phc2sys.o:phc2sys.c:(.text+0x67d): more undefined references to
print_get_level' follow collect2: error: ld returned 1 exit status