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

fatal error: 'memory' file not found #604

Closed
arthur8L opened this issue Aug 19, 2024 · 7 comments
Closed

fatal error: 'memory' file not found #604

arthur8L opened this issue Aug 19, 2024 · 7 comments

Comments

@arthur8L
Copy link

  1. Operating system: Windows

  2. The way you installed OpenCV: tried it using chocolatey and directly open

  3. OpenCV version: 4.10.0

  4. rustc version (rustc --version) : 1.80.1

  5. Attach the full output of the following command from your project directory:

    === WARNING:   1  diagnostic messages
        ===
           C:\Users\arthu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opencv-0.92.2\src_cpp\ocvrs_common.hpp:16:10: fatal error: 'memory' file not found
        thread ' main ' panicked at  C:\Users\arthu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opencv-binding-generator-0.90.2\src\generator.rs:
  402:17:
  === Errors during header parsing
  stack backtrace:
    27:     0x7ff690a34a8c - invoke_main
                                 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    28:     0x7ff690a34a8c - __scrt_common_main_seh
                                 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
     8:     0x7ff690a0ec68 - std::panicking::default_hook::closure$1
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:271
     9:     0x7ff690a0e916 - std::panicking::default_hook
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:298
    10:     0x7ff690a0f198 - std::panicking::rust_panic_with_hook
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:795
    11:     0x7ff690a0f019 - std::panicking::begin_panic_handler::closure$0
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:656
    12:     0x7ff690a0d3bf - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:171
    13:     0x7ff690a0ed08 - std::panicking::begin_panic_handler
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
    14:     0x7ff690a37054 - core::panicking::panic_fmt
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
    15:     0x7ff69071bcf2 - opencv_binding_generator::generator::Generator::handle_diags::h2390b6857677c99b
    16:     0x7ff6904db895 - opencv_binding_generator::generator::OpenCvWalker<V>::process_typedef::{{closure}}::h6ae3737a2b8a20fe
    17:     0x7ff6904dbc4f - opencv_binding_generator::generator::Generator::generate::hfff47ca3b24737cd
    18:     0x7ff6904f3916 - build_script_build::binding_generator::handle_running_binding_generator::h6b86608ac9fa0f76
    19:     0x7ff6904f30ce - build_script_build::binding_generator::handle_running_binding_generator::h6b86608ac9fa0f76
    20:     0x7ff6904c70c2 - build_script_build::setup_rerun::{{closure}}::{{closure}}::h36ae7995d87ee596
    21:     0x7ff6904dc166 - core::ops::function::FnOnce::call_once::h018c9c9a3030c343
     29:     0x7ff8e12a257d - BaseThreadInitThunk
   0:               at                at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rsD:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl::91      
     1:     0x7ff690a0ca4d - std::backtrace_rs::backtrace::trace_unsynchronized
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
     2:     0x7ff690a0ca4d - std::sys_common::backtrace::_print_fmt
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:68
     3:     0x7ff690a0ca4d - std::sys_common::backtrace::_print::impl$0::fmt
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:44
    22:     0x7ff6904f5979 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd6f238c4c118f494
    23:     0x7ff6904e4e5c - std::rt::lang_start::{{closure}}::h1d71bdcd8166b49a
    24:     0x7ff690a012ce - std::rt::lang_start_internal
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\rt.rs:141
    25:     0x7ff6904e4e37 - std::rt::lang_start::h4c50e08ec31faa0e
     26:      0x 7ff6904c8839  - 0xmain7ff690a0ca4d - std::backtrace_rs::backtrace::dbghelp64::trace
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
     1:     0x7ff690a0ca4d - std::backtrace_rs::backtrace::trace_unsynchronized
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
     2:     0x7ff690a0ca4d - std::sys_common::backtrace::_print_fmt
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:68
     3:        40x: 7ff690a0ca4d  -  std::sys_common::backtrace::_print::impl$0::fmt
    0x 7ff690a2de99  -  core::fmt::rt::Argument::fmt at  /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:44
  288
    27:     0x7ff690a34a8c - invoke_main at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
    28:     0x7ff690a34a8c - __scrt_common_main_seh
                                 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
     4:     0x7ff690a2de99 - core::fmt::rt::Argument::fmt
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\fmt\rt.rs:165
     5:     0x7ff690a2de99 - core::fmt::write
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\fmt\mod.rs:1168
     6:     0x7ff690a076d1 - std::io::Write::write_fmt<std::sys::pal::windows::stdio::Stderr>
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\io\mod.rs:1835
     7:     0x7ff690a0c826 - std::sys_common::backtrace::print
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:34
     8:     0x7ff690a0ec68 - std::panicking::default_hook::closure$1
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:271
     9:     0x7ff690a0e916 - std::panicking::default_hook
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:298
    10:     0x7ff690a0f198 - std::panicking::rust_panic_with_hook
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:795
    11:     0x7ff690a0f019 - std::panicking::begin_panic_handler::closure$0
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:656
    12:     0x7ff690a0d3bf - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:171
    13:     0x7ff690a0ed08 - std::panicking::begin_panic_handler
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
    14:     0x7ff690a37054 - core::panicking::panic_fmt
                                 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
    30:     0x7ff8e280af28 - RtlUserThreadStart
    15:     0x7ff69071bcf2 - opencv_binding_generator::generator::Generator::handle_diags::h2390b6857677c99b
    16:     0x7ff6904db895 - opencv_binding_generator::generator::OpenCvWalker<V>::process_typedef::{{closure}}::h6ae3737a2b8a20fe
    17:     0x7ff6904dbc4f - opencv_binding_generator::generator::Generator::generate::hfff47ca3b24737cd
    18:     0x7ff6904f3916 - build_script_build::binding_generator::handle_running_binding_generator::h6b86608ac9fa0f76
    19:     0x7ff6904f30ce - build_script_build::binding_generator::handle_running_binding_generator::h6b86608ac9fa0f76
    20:     0x7ff6904c70c2  -                 at  /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\fmt\rt.rs :29165:
   thread '<unnamed>' panicked at C:\Users\arthu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opencv-0.92.2\build\generator.rs:109:33:
  Failed to run the bindings generator for module: video

this similar backtrace log repeats for: calib3d, imgcodecs, etc...
like this

Failed to run the bindings generator for module: imgcodec
@lijingrs
Copy link

fatal error: 'memory' file not found
thread 'main' panicked at /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-binding-generator-0.90.2/src/generator.rs:402:17:
=== Errors during header parsing
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread '' panicked at /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-0.92.2/build/generator.rs:109:33:
Failed to run the bindings generator for module: imgcodecs
thread 'main' panicked at /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-0.92.2/build/generator.rs:118:36:
Generator process panicked: Any { .. }
=== Running: "/xdfapp/install/candle-svr/target/release/build/opencv-cb19da0d198514a0/build-script-build" "/usr/include/opencv4" "/root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-0.92.2/src_cpp" "/xdfapp/install/candle-svr/target/release/build/opencv-e1c1fd42a52bd040/out" "imgproc" ""
=== WARNING: 1 diagnostic messages
=== /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-0.92.2/src_cpp/ocvrs_common.hpp:16:10: fatal error: 'memory' file not found
thread 'main' panicked at /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-binding-generator-0.90.2/src/generator.rs:402:17:
=== Errors during header parsing
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread '' panicked at /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/opencv-0.92.2/build/generator.rs:109:33:
Failed to run the bindings generator for module: imgproc
warning: build failed, waiting for other jobs to finish...

@lijingrs
Copy link

ubuntu2204 has same error

@lijingrs
Copy link

Checking if the CPLUS_INCLUDE_PATH environment variable is incorrectly set can potentially interfere with the include path for standard libraries. You can check this variable by running echo $CPLUS_INCLUDE_PATH. If it is set and contains an incorrect path, you may need to clear or modify it.

In Ubuntu 22.04, I solved the issue by resetting the configuration.
/usr/include/x86_64-linux-gnu/c++/11

@k-bx
Copy link

k-bx commented Aug 20, 2024

@lijingrs it's empty on my relatively-fresh system, yet I get this error. Where should memory.h come from?

@k-bx
Copy link

k-bx commented Aug 20, 2024

UPDATE: I'm on POP_OS 22.04, and my fix was to apt-get remove cpp-12, seems to be some sort of conflict when having with cpp-11 and cpp-12 installed

@twistedfall
Copy link
Owner

twistedfall commented Aug 20, 2024

Missing system headers are usually the sign of the C++ standard library not installed or some header version mismatch. Can anyone experiencing this issue please follow item 9 in the troubleshooting?

@arthur8L
Copy link
Author

arthur8L commented Aug 20, 2024

Thanks for all you guys help. Got it working with @lijingrs suggestion updating CPLUS_INCLUDE_PATH to MSVC path Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\include

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

4 participants