Skip to content

Cross-compilation issues #504

Description

@arihant2math

Background:
I am cross-compiling from windows to android, the package compiles fine for windows, but the cross compilation is failing.
The error seems to be coming from the opencv-binding-generator, specifically

  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__support/win32/locale_win32.h:96:7: error: definition of type 'locale_t' conflicts with typedef of the same name
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:445:32: error: use of undeclared identifier '_SPACE'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:446:32: error: use of undeclared identifier '_BLANK'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:446:39: error: use of undeclared identifier '_PUNCT'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:446:46: error: use of undeclared identifier '_ALPHA'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:446:53: error: use of undeclared identifier '_DIGIT'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:447:32: error: use of undeclared identifier '_CONTROL'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:448:32: error: use of undeclared identifier '_UPPER'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:449:32: error: use of undeclared identifier '_LOWER'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:450:32: error: use of undeclared identifier '_ALPHA'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:451:32: error: use of undeclared identifier '_DIGIT'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:452:32: error: use of undeclared identifier '_PUNCT'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:453:32: error: use of undeclared identifier '_HEX'
  ===    C:/Users/ariha/AppData/Local/Android/Sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/windows-x86_64/bin/../sysroot/usr/include/c++/v1\__locale:454:32: error: use of undeclared identifier '_BLANK'

specific error from package:

===    fatal error: too many errors emitted, stopping now [-ferror-limit=]
  thread 'main' panicked at '=== Errors during header parsing', opencv-rust\binding-generator\src\generator.rs:396:17
  stack backtrace:
    31:     0x7ffb12f5257d - BaseThreadInitThunk
   14:     0x7ff65619c3e2 - opencv_binding_generator::generator::Generator::pre_process<opencv_binding_generator::generator::impl$4::generate::closure_env$0<opencv_binding_generator::writer::rust_native::RustNativeBindingWriter> >
                                 at D:\visionrs\opencv-rust\binding-generator\src\generator.rs:436
    15:     0x7ff65619c7e2 - opencv_binding_generator::generator::Generator::generate<opencv_binding_generator::writer::rust_native::RustNativeBindingWriter>
                                 at D:\visionrs\opencv-rust\binding-generator\src\generator.rs:442
    16:     0x7ff65619e020 - build_script_build::binding_generator::run<core::iter::adapters::peekable::Peekable<std::env::ArgsOs> >
                                 at D:\visionrs\opencv-rust\build\binding-generator.rs:45
    17:     0x7ff6561b0bb6 - build_script_build::binding_generator::handle_running_binding_generator
                                 at D:\visionrs\opencv-rust\build\binding-generator.rs:18
    18:     0x7ff656195057 - build_script_build::main
                                 at D:\visionrs\opencv-rust\build.rs:319
    19:     0x7ff6561bbb6b - core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,alloc::boxed::Box<dyn$<core::error::Error>,alloc::alloc::Global> > > (*)(),tuple$<> >
                                 at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3\library\core\src\ops\function.rs:250
    32:     0x7ffb14c0aa78 - RtlUserThreadStart

Google isn't being very helpful, but I'm pretty sure that the issue might be that something isn't being declared as opaque in the bindgen generator? I'm not very good with this stuff, so it's just a theory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions