protonscr

Compiler can't find math.h and stdlib.h

dxvkclosed build
doitsujin/dxvk#799 · opened 2018-12-05 by Sukid · updated 2018-12-09 · 5 comments · github
SSukid 2018-12-05 github

Trying to compile for Winelib, and whether I use the AUR or download and compile manually (even the stable source), I get these two errors multiple times:
/usr/include/c++/8.2.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>

/usr/include/c++/8.2.1/cmath:45:15: fatal error: math.h: No such file or directory
#include_next <math.h>

And the build fails.

I'm starting to think this is something particular to my system since I'm not seeing a lot of people mention this issue with regards to DXVK.

Ccharming-byte 2018-12-07 github

I encountered the same issue on two fresh arch linux installations when attempting to build wine with DXVK winelib and wine-staging (3.21-1) installed from the multilib repository.

The solution for me was to do a clean build of wine (wine-staging) without DXVK winelib and using this as base for compiling wine again but now with DXVK winelib enabled.

TTk-Glitch 2018-12-07 github

You need to revert 0e279d26b8386fc878f17bd6768e46e1cf9c5128 commit in wine mainline to get a wine build able to build DXVK.

SSukid 2018-12-09 github

Thanks guys! I'll have a look at those. I also found out that you can also edit cstdlib and cmath, and change the #include_next for stdlib.h and math.h to just #include. It compiles just fine after that. Not sure about the long term ramifications of doing that though, so perhaps either of your solutions would be better...

Well with three solutions I'm not sure whether I should close this or leave it open since this might still present an issue for dxvk itself despite easy enough workarounds...

Ddoitsujin maintainer 2018-12-09 github

Not sure what I'm supposed to do about that though. These headers are used by some standard C++ headers, if winegcc can't find them then it obviously won't work.

SSukid 2018-12-09 github

True! Well that answer's that. That would be more of a wine problem than anything. Alrighty then!

Nothing extracted yet.