mingw/include/c++/cstdlib: stdlib.h: No such file or directory

前端 未结 2 1716
青春惊慌失措
青春惊慌失措 2020-12-18 03:08

I am trying to cross-compile OpenImageIO for 64-bit Windows on Fedora 26 using MinGW. After using yum to retrieve the mingw versions of the dependencies, I ran

相关标签:
2条回答
  • 2020-12-18 03:22

    I solved it, i can compile again.

    The solution (for me) is add to path the variable CPLUS_INCLUDE_PATH and set it to the MinGW c++ include directory, for me: C:\MinGW\lib\gcc\mingw32\6.3.0\include\c++.

    I hope it works for you too.

    0 讨论(0)
  • 2020-12-18 03:27

    The use of #include_next appears to cause lots of issues based on my Googling. Try directly including stdlib.h using the following syntax:

    -isystem /usr/x86_64-w64-ming32/sys-root/mingw/include/c++
    

    This syntax was added in gcc 6.0 to solve issues with third-party libraries. See here for the approach and reasoning.

    Edit: Changed answer to reflect new information about gcc wrapper_headers and #include_next

    0 讨论(0)
提交回复
热议问题