rockowitz / ddcui

Graphical user interface for ddcutil - control monitor settings
http://www.ddcutil.com
GNU General Public License v2.0
147 stars 2 forks source link

value_nc_widget.cpp ‘struct DDCA_Feature_Metadata’ has no member named ‘latest_sl_values’ #32

Open 532910 opened 2 years ago

532910 commented 2 years ago
[ 62%] Building CXX object CMakeFiles/ddcui.dir/src/feature_value_widgets/value_nc_widget.cpp.o
/tmp/ddcui/src/feature_value_widgets/value_nc_widget.cpp: In member function ‘void ValueNcWidget::loadComboBox2()’:
/tmp/ddcui/src/feature_value_widgets/value_nc_widget.cpp:226:41: error: ‘struct DDCA_Feature_Metadata’ has no member named ‘latest_sl_values’
  226 |          (_useLatestNcValues) ? _finfo->latest_sl_values :  _finfo->sl_values;
      |                                         ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ddcui.dir/build.make:655: CMakeFiles/ddcui.dir/src/feature_value_widgets/value_nc_widget.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/ddcui.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

libddcutil-dev v0.9.9-2 from debian sid

btw, it also draws a warning on 39% of building process:

[ 39%] Building C object CMakeFiles/ddcui.dir/src/cmdline/ddcui_cmd_parser.c.o
/tmp/ddcui/src/cmdline/ddcui_cmd_parser.c: In function ‘parse_ddcui_command’:
/tmp/ddcui/src/cmdline/ddcui_cmd_parser.c:597:14: warning: implicit declaration of function ‘ddca_ddcutil_extended_version_string’; did you mean ‘ddca_ddcutil_version_string’? [-Wimplicit-function-declaration]
  597 |              ddca_ddcutil_extended_version_string(), qVersion());
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              ddca_ddcutil_version_string
rockowitz commented 2 years ago

The version of ddcutil/libddcutil/libddcutil-dev in sid is 0.9.9, which is ancient. Hopefully it will jump to 1.2.1 after that ddcutil version is released and submitted to debian.

ddcui 0.2.0 requires at least libddcutil.so.4.1.0 from ddcutil 1.2.0 or later. This requirement was mentioned in the release description, but needs to be more prominent. I have added it to the announcement in #33, and to the ddcui Release Notes on the web site.

Thanks you for the report. I look forward to your feedback.

532910 commented 2 years ago

I installed llibddcutil-dev only after cmake failed with:

-- Checking for module 'ddcutil>=0.9.9'
--   No package 'ddcutil' found

https://github.com/rockowitz/ddcui/blob/448ee8affd6e08ca7af1bcfdeedb12e5bbcd75d7/CMakeLists.txt#L54 min version should be updated, isn't it?

rockowitz commented 2 years ago

There are several problems with pkg_check_modules

The first is simply that the version on the pkg_check_modules() call needs to be updated to 1.2.0. My oversight. It has been fixed on the 0.2.1-dev branch. Thanks for pointing this out.

The remaining problems lack easy solutions. (Please forgive the long discussion. I may use it as the basis for a section in the ddcutil documentation.)

Second is the naming of the pkg-config file, in this case "ddcutil.pc". There's no specification as to what the file should be named (other than ending in ".pc".) Looking in /usr/lib/x86_64-linux-gnu/pkgconfig, some package names begin with "lib" (e.g. libudev.pc), others do not (e.g. glib-2.0.pc). I chose the latter form because that is what is used in the examples in the freedesktop.org (Guide to pkg-config](https://people.freedesktop.org/~dbn/pkg-config-guide.html) as well as other examples I found. This has the unfortunate consequence that the error message takes "ddcutil" from the pkg-config package name, which can be particularly confusing because "ddcutil" is than name of the the .deb or .rpm package of the command line copy of ddcutil. In retrospect "libddcutil.pc" would have been a better choice. I may bite the bullet and change the name, which would cause use in existing CMakeList.txt files pkg_check_modules() calls, and autoconf's PKG_CHECK_MODULES() calls, to fail.

Relatedly, the error message suggests that it's the shared library package for libddcutil that's missing, when it fact it's the "dev" package libddcutil-dev that's missing. There's an entry in the (ddcutil FAQ)(https://www.ddcutil.com/faq#missing_package) about this source of confusion.

Finally, the word "package" itself has ambiguity. In this case it refers to the .deb, .rpm or such package. However, "ddcutil" is the git repository/tarball name from which all the ddcutil packages (ddcutil, libddcutil, libddcutil-dev, etc.) are built, and if you're installing from source it's ddcutil that you install.

Regards, Sanford