MINGW-packages: gcc seems broken
After updating MSYS2 this morning, I cannot compile my app any more, getting this error:
C:/msys64/mingw64/include/c++/11.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
75 | #include_next <stdlib.h>
| ^~~~~~~~~~
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 67 (53 by maintainers)
Commits related to this issue
- fix: force build sqlite from contribs on msys2 This addresses the following issue (in a probably non-ideal way): on current msys2 `pkg-config sqlite3 --cflags-only-I` returns `-IC:/msys64/mingw64/inc... — committed to crawl/crawl by rawlins 2 years ago
- Disable -isystem with MinGW on msys2 See https://github.com/msys2/MINGW-packages/issues/10761 — committed to NazaraEngine/NazaraEngine by SirLynix 2 years ago
- scons: Disable -isystem conversion if sys.platform == "win32" msys2 pkg-config adds root system include path among -I flags and passing it with -isystem isn't supported by gcc, and the workaround of ... — committed to wesnoth/wesnoth by loonycyborg 2 years ago
I managed to reduce the problem to a very simple
hello_world.cpp
example:Yes, luckily the fix is very simple: remove
-isystem /mingw64/include
. I just applied it here so that we can compile our application again.We can probably close the issue now.
There is a core change in system crt and headers. So, GCC is being rebuilt in CI right now. Please wait for the fix.
GCC upgrade to
11.2.0-9
Ty @lazka @Biswa96 but it still breaks for me with the latest gcc upgrade you pushed, it looks like similar to the issue @omichel is having
Unexpected behavior
CLion is no more capable of using a MinGW toolchain under Windows and is displaying the message
Not found
Log of what is behind “Not found”
I enabled the log of category
#com.jetbrains.cidr.cpp
and found the following relevant issueDoes not seem to be exactly linked to this issue, rather it seems you may just have issues with linking, not with the headers. You may want to research more on linking in general, but as a start point, I would suggest looking into how to use pkg-config.
If you want an exact answer, try running
instead of just
gcc main.c
. The output of the commandpkgconf --static --libs jansson libcurl
will tell gcc which libraries you will need to be able to link against jansson and curl.Example of the issue happening with -isystem: https://github.com/NazaraEngine/NazaraEngine/runs/7413695221?check_suite_focus=true#step:12:4179
you’re looking at the wrong package, the ones provided by the c++ related packages are supposed to be helper includes for C++ code when including the .h version rather than
cstdlib
i reverted all the path changes in my local build and so far all seems to run again except some problem building qt6 but i think that is unrelated to this issue since it also failed with the original compiler.
I’ve seen it from time to time crop up in CI, so I’m wondering if some part of it is not deterministic.
No problem on my side after today’s update, everything compiles smoothly.
So for somebody confused by the thread here, the issue is that the sysroot parameter isn’t working with GCC anymore?
I’m having the same issue with my MinGW64 CI: https://github.com/DigitalPulseSoftware/NazaraEngine/runs/5231389195?check_suite_focus=true#step:10:52
Edit: Issue reported to the CLion team here https://youtrack.jetbrains.com/issue/CPP-28403
@Biswa96
indeed I think CLion checks for a static file location for checking the validity of the toolchain because that’s what show the Java stacktrace
Ty for helping out guys, I think I don’t have a better solution yet than creating a symlink while waiting for the newest CLion 2022.1 😃
thanks, yeah, something is still off.
I can’t reproduce though.
OK, thank you for the quick reply!