Yubico / yubikey-personalization

YubiKey Personalization cross-platform library and tool
https://developers.yubico.com/yubikey-personalization/
BSD 2-Clause "Simplified" License
297 stars 83 forks source link

Linux compilation error in ykpers-json.c #188

Open RogueScholar opened 4 months ago

RogueScholar commented 4 months ago

Attempting to compile from source on Kubuntu 23.10 using GCC 13.2.0 resulted in the following error:

ykpers-json.c: In function 'set_json_value':
ykpers-json.c:53:27: error: 'TRUE' undeclared (first use in this function)
   53 |                 if(ret == TRUE && json_object_get_type(joption) == json_type_boolean) {
      |                           ^~~~
ykpers-json.c:53:27: note: each undeclared identifier is reported only once for each function it appears in
ykpers-json.c: In function '_ykp_json_import_cfg':
ykpers-json.c:230:85: error: 'FALSE' undeclared (first use in this function)
  230 |                 if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == FALSE) {
      |                                                                                     ^~~~~
ykpers-json.c:243:86: error: 'TRUE' undeclared (first use in this function)
  243 |                 if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == TRUE) {
      |                                                                                      ^~~~
make[1]: *** [Makefile:789: ykpers-json.lo] Error 1

The build was configured using the following flags on a clean environment:

$ ./configure --sysconfdir=/etc --sharedstatedir=/var/lib --localstatedir=/var --runstatedir=/run --libdir=/usr/local/lib/x86_64-linux-gnu --includedir=/usr/local/include/x86_64-linux-gnu --with-backend=libusb-1.0 --with-udevrulesdir=/usr/lib/udev/rules.d
  ...
  configure: summary of build options:

  version:           1.19.0 shared 20:0:19 major 1 minor 19 patch 0 number 0x011300
  Host type:         x86_64-pc-linux-gnu
  Install prefix:    /usr/local
  Compiler:          gcc
  Library types:     Shared=yes, Static=yes
  USB backend:       libusb-1.0
  JSON library:      yes
    CFLAGS:          -I/usr/include/json-c
    LIBS:            -ljson-c
    pretty printing: yes
  udev rules dir:    /usr/lib/udev/rules.d
  udev rules file:   69-yubikey.rules

Relevant installed dependency versions are as follows:

Please advise.