-1

To make it simple, I want to use the OpenCV libs within my embedded ElinOS system, while programming on my Windows machine.

To do so, I downloaded OpenCV sources for Linux on the website and I'm trying to compile it using cygwin and cmake to generate the Makefile. However, I have an error occuring during the "make" step, which is /usr/include/wchar.h:41:25: fatal error : bits/wchar.h : No such file or directory

I understand the problem, which is basically that cygwin should use /opt/elinos-6.0/cdk/x86/x86_64/eglibc-2.17/x86_64-unkown-linux-gnu/include instead of /usr/include but I have basically no idea how to change that.

That far, I added those two lines to the CMakeLists.txt

set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
include_directories(BEFORE C:/sysgo/opt/elinos-6.0/cdk/x86/x86_64/eglibc-2.17/x86_64-unkown-linux-gnu/include/)

and this line to the builded Makefile:

INC = -I/cygdrive/c/sysgo/opt/elinos-6.0/cdk/x86/x86_64/eglibc-2.17/x86_64-unknown-linux-gnu/include/

But it didn't work, I still got the same error. Any help is welcome, and I would be glad if an explanation comes with the magic command line(s) that will help. Thanks in advance!

Axel B.
  • 131
  • 7

1 Answers1

1

one way for you might be to clear the standard include path completly:

first delete standard path with -nostdinc and then put your own directories in it.

you might not want loose all of them, here is a way to see which are used in the standard include path: echo "//" | gcc -xc++ -E -v - (works also with clang)

Here is a fine article for this for gcc :

http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art026

here you can read it works with clang too:

http://clang.llvm.org/docs/CommandGuide/clang.html

goeddek
  • 109
  • 1
  • 7
  • 1
    Note that this is gcc-specific - different compilers have different rules for search order. – Paul R Nov 28 '16 at 12:51
  • Thanks for your answers, and especially for the very interesting articles. I've tried the cpp -I/... command in my cygwin terminal and it worked. However, it's not permanent. Where should I integrate that during my compilation process? I don't see any specification about my gcc compiler neither in the CMakeLists.txt nor in the created Makefile. I'm not very familiar with compilers, thanks for your answers! – Axel B. Nov 28 '16 at 14:15
  • @AxelB. i dont know much about CMake, but I found this here on SO: http://stackoverflow.com/questions/11783932/how-to-add-linker-or-compile-flag-in-cmake-file this looks like something you can use... – goeddek Nov 28 '16 at 14:34