opencv-rust icon indicating copy to clipboard operation
opencv-rust copied to clipboard

Unexpectedly weird errors while compiling a project with opencv-rust

Open timleg002 opened this issue 2 years ago • 8 comments

12.12.2023 OPENCV-RUST LOG.txt

  1. Operating system

    Windows 11 Pro 21H2

  2. The way you installed OpenCV: package, official binary distribution, manual compilation, etc.

    Via chocolatey

  3. OpenCV version

    4.8.1

  4. rustc version (rustc --version)

    rustc 1.76.0-nightly (21cce21d8 2023-12-11)

I have attached the full log, but in short: very weird errors. I haven't been able to find anything at all about this. This error occurs with opencv bindgen, failing to run the bindings generator for every opencv module. This line keeps repeating (with some variations): c:/MinGW64/x86_64-w64-mingw32/include\stdlib.h:388:47: error: expected ';' after top level declarator. It seems as if I was using some weird compilator? I don't know. I tried both the msvc and the gnu target triple (for x64 Windows), both give the same error.

timleg002 avatar Dec 12 '23 13:12 timleg002

I think you haven't in fact attached the full build log unless I'm missing something

twistedfall avatar Dec 12 '23 13:12 twistedfall

I think you haven't in fact attached the full build log unless I'm missing something

You're right - I uploaded the file, but for some reason it wasn't there. Thank you for the fast reply - it's attached now!

timleg002 avatar Dec 12 '23 13:12 timleg002

Looks like the stdlib headers are not processed correctly. I'm not sure how to help here to be honest and I've never tested build with mingw. There is also this warning that's very suspicious in the logs:

warning: "__STRICT_ANSI__ seems to have been undefined; this is not supported"

twistedfall avatar Dec 14 '23 11:12 twistedfall

I also tried building with MSVC, but got the same errors (with the stdlib headers). It all feels like I made a mistake configuring all of this, but I retraced all of my steps and don't think I found anything wrong.

timleg002 avatar Dec 25 '23 15:12 timleg002

Sorry for bumping, currently facing the same issue. Any work arounds?

icedcoffeeee avatar Apr 26 '24 16:04 icedcoffeeee

Are you using mingw on Windows too?

twistedfall avatar Apr 26 '24 18:04 twistedfall

Yes, I am. My errors are equivalent to OP.

icedcoffeeee avatar Apr 26 '24 18:04 icedcoffeeee