FedeDP / Clightd

A linux bus interface that lets you change screen brightness, compute captured webcam frames brightness and change screen temperature.
GNU General Public License v3.0
82 stars 10 forks source link

[BUG] Build Errors on Fedora after recent updates to Backlight.c & Backlight2.c #81

Closed hunterzero99 closed 2 years ago

hunterzero99 commented 2 years ago

My system is presenting build errors after the recent updates to Backlight.c & Backlight2.c I rolled back backlight.c to commit 9c6ba31 on Aug 2, and backlight2.c to commit bb0b16f on Aug 2 and the build was successful. Maybe there is a new dependency which I am missing.

Errors below were encountered when trying to build on the latest release:

[ 6%] Building C object CMakeFiles/clightd.dir/src/modules/backlight2.c.o /home/user/build/Clightd/src/modules/backlight2.c: In function ‘update_external_devices’: /home/user/build/Clightd/src/modules/backlight2.c:202:9: warning: implicit declaration of function ‘ddca_redetect_displays’; did you mean ‘ddca_report_displays’? [-Wimplicit-function-declaration] 202 | ddca_redetect_displays(); | ^~~~~~~~~~~~~~~~~~~~~~ | ddca_report_displays [ 10%] Linking C executable clightd /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight2.c.o: in functionreceive': backlight2.c:(.text+0x1122): undefined reference to ddca_redetect_displays' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/clightd.dir/build.make:529: clightd] Error 1 make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/clightd.dir/all] Error 2 make: *** [Makefile:156: all] Error 2 Consolidate compiler generated dependencies of target clightd [ 3%] Linking C executable clightd /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight2.c.o: in functionreceive': backlight2.c:(.text+0x1122): undefined reference to `ddca_redetect_displays' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/clightd.dir/build.make:529: clightd] Error 1 make[1]: [CMakeFiles/Makefile2:100: CMakeFiles/clightd.dir/all] Error 2 make: *** [Makefile:156: all] Error 2

I first only rolled back backlight2.c, these errors were generated which led me to roll back backlight.c as well: Consolidate compiler generated dependencies of target clightd [ 3%] Building C object CMakeFiles/clightd.dir/src/modules/backlight.c.o [ 3%] Building C object CMakeFiles/clightd.dir/src/modules/backlight2.c.o [ 3%] Linking C executable clightd /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_getbrightness1': backlight.c:(.text+0xf1): undefined reference to bls' /usr/bin/ld: backlight.c:(.text+0x13d): undefined reference toget_backlight' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_lowerbrightness1': backlight.c:(.text+0x1e2): undefined reference tobls' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_setbrightness1': backlight.c:(.text+0x272): undefined reference tobls' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_raisebrightness1': backlight.c:(.text+0x302): undefined reference tobls' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_lowerallbrightness': backlight.c:(.text+0x93): undefined reference tomethod_lowerbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_raiseallbrightness': backlight.c:(.text+0xa3): undefined reference tomethod_raisebrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_setallbrightness': backlight.c:(.text+0x183): undefined reference tomethod_setbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_getallbrightness': backlight.c:(.text+0x193): undefined reference tomethod_getbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_lowerbrightness1': backlight.c:(.text+0x213): undefined reference tomethod_lowerbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_setbrightness1': backlight.c:(.text+0x2a3): undefined reference tomethod_setbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_raisebrightness1': backlight.c:(.text+0x333): undefined reference tomethod_raisebrightness' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/clightd.dir/build.make:529: clightd] Error 1 make[1]: [CMakeFiles/Makefile2:100: CMakeFiles/clightd.dir/all] Error 2 make: [Makefile:156: all] Error 2 Consolidate compiler generated dependencies of target clightd [ 3%] Linking C executable clightd /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in function method_getbrightness1': backlight.c:(.text+0xf1): undefined reference tobls' /usr/bin/ld: backlight.c:(.text+0x13d): undefined reference to get_backlight' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_lowerbrightness1': backlight.c:(.text+0x1e2): undefined reference to bls' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_setbrightness1': backlight.c:(.text+0x272): undefined reference to bls' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_raisebrightness1': backlight.c:(.text+0x302): undefined reference to bls' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_lowerallbrightness': backlight.c:(.text+0x93): undefined reference to method_lowerbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_raiseallbrightness': backlight.c:(.text+0xa3): undefined reference to method_raisebrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_setallbrightness': backlight.c:(.text+0x183): undefined reference to method_setbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_getallbrightness': backlight.c:(.text+0x193): undefined reference to method_getbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_lowerbrightness1': backlight.c:(.text+0x213): undefined reference to method_lowerbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_setbrightness1': backlight.c:(.text+0x2a3): undefined reference to method_setbrightness' /usr/bin/ld: CMakeFiles/clightd.dir/src/modules/backlight.c.o: in functionmethod_raisebrightness1': backlight.c:(.text+0x333): undefined reference to `method_raisebrightness' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/clightd.dir/build.make:529: clightd] Error 1 make[1]: [CMakeFiles/Makefile2:100: CMakeFiles/clightd.dir/all] Error 2 make: [Makefile:156: all] Error 2

FedeDP commented 2 years ago

Hi! Thanks for opening this bug report! It seems like it is trying to build a ddcutil feature that is only available since ddcutil 1.2.0. The weird thing is I am building Clightd on a ddcutil 1.2.0 laptop and a 1.1.0 one, and I'm not encountering such issue. Code too looks fine to me.

Which ddcutil version are you on?

hunterzero99 commented 2 years ago

Looks like the release in Fedora 35 is really outdated; it's installing ddcutil-0.9.9-5

Solution looks to be to build a more recent version of ddcutil from source.

FedeDP commented 2 years ago

Hi! It is weird anyway: Clightd does only build the new feature if ddcutil >= 1.2.0 is found, thus it is backward compatible!

The weird thing is I am building Clightd on a ddcutil 1.2.0 laptop and a 1.1.0 one, and I'm not encountering such issue.

With this sentence I meant that I'm already building a Clightd with the new monitor hotplug feature support, and ine without, and it builds fine! May be you should clean your cmake cache? Ie: remove the build folder and start from scratch?

FedeDP commented 2 years ago

Moreover, archlinux is still on 1.1.0, thus every user building from AUR should've encountered your same issue (and, and as far as I know, nobody has!)

FedeDP commented 2 years ago

Can you share output of cat /usr/include/ddcutil_macros.h? Thank you!

hunterzero99 commented 2 years ago
[user@acamar build]$ cat /usr/include/ddcutil_macros.h 
/** @file ddcutil_macros.h.in
 *
 *  Macros for checking ddcutil version at compile time. 
 *  The Autotools build system converts this file to ddcutil.macros.h 
 *  at build time. The version values are set from those in configure.ac. 
 */

// Copyright (C) 2018 Sanford Rockowitz <rockowitz@minsoft.com>
// SPDX-License-Identifier: GPL-2.0-or-later

#define DDCUTIL_VMAJOR 0
#define DDCUTIL_VMINOR 9
#define DDCUTIL_VMICRO 9
FedeDP commented 2 years ago

Hi! The issue should be fixed in latest master. Thanks!