Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solved] Compilation error on Linux Mint: 'stdarg.h' file not found #57

Closed
schmauder opened this issue Mar 24, 2023 · 2 comments
Closed
Assignees

Comments

@schmauder
Copy link

hi there! when compiling a rust project using gphoto2-rs under linux mint i get the following error:

          $ cargo run
           Compiling libgphoto2_sys v1.2.0
          error: failed to run custom build command for `libgphoto2_sys v1.2.0`
          
          Caused by:
            process didn't exit successfully: `/home/<project-folder>/target/debug/build/libgphoto2_sys-7987dc01ee9af43d/build-script-build` (exit status: 101)
            --- stdout
            cargo:rerun-if-env-changed=LIBGPHOTO2_NO_PKG_CONFIG
            cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG
            cargo:rerun-if-env-changed=PKG_CONFIG
            cargo:rerun-if-env-changed=LIBGPHOTO2_STATIC
            cargo:rerun-if-env-changed=LIBGPHOTO2_DYNAMIC
            cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
            cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
            cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
            cargo:rerun-if-env-changed=PKG_CONFIG_PATH
            cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
            cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
            cargo:rerun-if-env-changed=SYSROOT
            cargo:rerun-if-env-changed=LIBGPHOTO2_STATIC
            cargo:rerun-if-env-changed=LIBGPHOTO2_DYNAMIC
            cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
            cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
            cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu
            cargo:rustc-link-lib=gphoto2
            cargo:rustc-link-lib=m
            cargo:rustc-link-lib=gphoto2_port
            cargo:rustc-link-lib=m
            cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG
            cargo:rerun-if-env-changed=PKG_CONFIG
            cargo:rerun-if-env-changed=LIBGPHOTO2_STATIC
            cargo:rerun-if-env-changed=LIBGPHOTO2_DYNAMIC
            cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
            cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
            cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
            cargo:rerun-if-env-changed=PKG_CONFIG_PATH
            cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
            cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
            cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
            cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
          
            --- stderr
            /usr/include/gphoto2/gphoto2-port-log.h:24:10: fatal error: 'stdarg.h' file not found
            thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("/usr/include/gphoto2/gphoto2-port-log.h:24:10: fatal error: 'stdarg.h' file not found\n")', /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/libgphoto2_sys-1.2.0/src/build.rs:35:6
            stack backtrace:
               0:     0x55a4fc4b1a5a - std::backtrace_rs::backtrace::libunwind::trace::hba70c054c9cdbd74
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
               1:     0x55a4fc4b1a5a - std::backtrace_rs::backtrace::trace_unsynchronized::hfff24a4d77b00fef
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
               2:     0x55a4fc4b1a5a - std::sys_common::backtrace::_print_fmt::h6fb3e9652d3b4f4e
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:65:5
               3:     0x55a4fc4b1a5a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h254ba81a1e20fed0
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:44:22
               4:     0x55a4fc4d6ffe - core::fmt::write::h232ccd94259bfe24
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/fmt/mod.rs:1213:17
               5:     0x55a4fc4aebe5 - std::io::Write::write_fmt::h963cfaecfdd596f7
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/io/mod.rs:1682:15
               6:     0x55a4fc4b1825 - std::sys_common::backtrace::_print::h6fbc4343523214ce
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:47:5
               7:     0x55a4fc4b1825 - std::sys_common::backtrace::print::h55ab07cec21aacd5
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:34:9
               8:     0x55a4fc4b322f - std::panicking::default_hook::{{closure}}::hc10df65206eee69e
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:267:22
               9:     0x55a4fc4b2f6b - std::panicking::default_hook::hdd684731d8d78925
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:286:9
              10:     0x55a4fc4b3939 - std::panicking::rust_panic_with_hook::h58681788b2d08dc0
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:688:13
              11:     0x55a4fc4b36d9 - std::panicking::begin_panic_handler::{{closure}}::he6d9da406579493c
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:579:13
              12:     0x55a4fc4b1f0c - std::sys_common::backtrace::__rust_end_short_backtrace::h5b1f3b233c047d47
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:137:18
              13:     0x55a4fc4b33e2 - rust_begin_unwind
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:575:5
              14:     0x55a4fbfb5c13 - core::panicking::panic_fmt::hea602a2467b5109d
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/panicking.rs:64:14
              15:     0x55a4fbfb60c3 - core::result::unwrap_failed::he3f6a4db4030a3f8
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/result.rs:1790:5
              16:     0x55a4fbfb9d67 - core::result::Result<T,E>::expect::hbaab93758227f04c
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/result.rs:1069:23
              17:     0x55a4fbfb9815 - build_script_build::main::h4895ba51fb0920c7
                                           at /home/js/.cargo/registry/src/github.com-1ecc6299db9ec823/libgphoto2_sys-1.2.0/src/build.rs:24:18
              18:     0x55a4fbfb72bb - core::ops::function::FnOnce::call_once::h37466a4baa549378
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/ops/function.rs:250:5
              19:     0x55a4fbfb752e - std::sys_common::backtrace::__rust_begin_short_backtrace::h8d2f616e44d46b44
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:121:18
              20:     0x55a4fbfb6f91 - std::rt::lang_start::{{closure}}::hf44732de27ff8381
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/rt.rs:166:18
              21:     0x55a4fc4aaebc - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2dd1a24ae3e0569f
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/ops/function.rs:287:13
              22:     0x55a4fc4aaebc - std::panicking::try::do_call::h71e38d3ed05d0919
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:483:40
              23:     0x55a4fc4aaebc - std::panicking::try::h9dd8fea17c119511
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:447:19
              24:     0x55a4fc4aaebc - std::panic::catch_unwind::h073a10d358958706
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panic.rs:140:14
              25:     0x55a4fc4aaebc - std::rt::lang_start_internal::{{closure}}::h0cf5d9b5652f6b98
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/rt.rs:148:48
              26:     0x55a4fc4aaebc - std::panicking::try::do_call::hc59ab1d339fa21e7
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:483:40
              27:     0x55a4fc4aaebc - std::panicking::try::h40dd3124b394a6da
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:447:19
              28:     0x55a4fc4aaebc - std::panic::catch_unwind::hff10c6c48e0fc17d
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panic.rs:140:14
              29:     0x55a4fc4aaebc - std::rt::lang_start_internal::h7868f0ffe3ad1ec2
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/rt.rs:148:20
              30:     0x55a4fbfb6f6a - std::rt::lang_start::h22ae034c20e50bce
                                           at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/rt.rs:165:17
              31:     0x55a4fbfb9aae - main
              32:     0x7f70e08be083 - __libc_start_main
                                           at /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
              33:     0x55a4fbfb62ae - _start
              34:                0x0 - <unknown>

rust ist up to date, it is installed via rustup. maybe i'm missing a linux package or there is a file linking issue. libgphoto2-dev is installed.
my system:

    System:    Kernel: 5.15.0-67-generic x86_64 bits: 64 Desktop: Cinnamon 5.2.7 
               Distro: Linux Mint 20.3 Una 
    Machine:   Type: Laptop System: Dell product: Latitude 3520 v: N/A serial: <filter> 
               Mobo: Dell model: 03VVMC v: A00 serial: <filter> UEFI: Dell v: 1.23.2 
               date: 10/27/2022 
    Battery:   ID-1: BAT0 charge: 54.0 Wh condition: 54.0/54.0 Wh (100%) 
    CPU:       Topology: Quad Core model: 11th Gen Intel Core i5-1135G7 bits: 64 type: MT MCP 
               L2 cache: 8192 KiB 
               Speed: 1041 MHz min/max: 400/4200 MHz Core speeds (MHz): 1: 937 2: 888 3: 633 4: 941 
               5: 1004 6: 1007 7: 900 8: 1090 
    Graphics:  Device-1: Intel driver: i915 v: kernel 
               Display: server: X.Org 1.20.13 driver: modesetting unloaded: fbdev,vesa 
               resolution: 1920x1080~60Hz 
               OpenGL: renderer: Mesa Intel Xe Graphics (TGL GT2) v: 4.6 Mesa 21.2.6 
    Audio:     Device-1: Intel driver: sof-audio-pci-intel-tgl 
               Device-2: Logitech HD Pro Webcam C920 type: USB driver: snd-usb-audio,uvcvideo 
               Sound Server: ALSA v: k5.15.0-67-generic 
    Network:   Device-1: Intel driver: iwlwifi 
               IF: wlp0s20f3 state: down mac: <filter> 
               Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 
               IF: enp43s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
    Drives:    Local Storage: total: 238.47 GiB used: 300.88 GiB (126.2%) 
               ID-1: /dev/nvme0n1 model: KBG40ZNS256G NVMe KIOXIA 256GB size: 238.47 GiB 
    RAID:      Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd 
    Partition: ID-1: / size: 159.84 GiB used: 150.40 GiB (94.1%) fs: ext4 dev: /dev/nvme0n1p6 
    Sensors:   System Temperatures: cpu: 37.0 C mobo: N/A 
               Fan Speeds (RPM): N/A 
    Info:      Processes: 283 Uptime: 3h 55m Memory: 7.51 GiB used: 4.76 GiB (63.3%) Shell: bash 
               inxi: 3.0.38
@maxicarlos08
Copy link
Owner

I don't really know whats going on there, though it might be similar to this: rust-lang/rust-bindgen#242 (comment)

Just to make sure, have you also installed clang?

@maxicarlos08 maxicarlos08 self-assigned this Mar 24, 2023
@schmauder
Copy link
Author

Ah, that was the missing package, thanks a lot!

@schmauder schmauder changed the title Compilation error on Linux Mint: 'stdarg.h' file not found [Solved] Compilation error on Linux Mint: 'stdarg.h' file not found Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants