root@vultr:~/code/go/src/github.com/filecoin-project/go-filecoin# FILECOIN_USE_PRECOMPILED_RUST_PROOFS=true go run ./build/*.go deps
pkg-config --version
0.29.1
Installing dependencies...
go get -u github.com/whyrusleeping/gx
runtime/cgo
_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory
include
^~~~~~
compilation terminated.
Command 'go get -u github.com/whyrusleeping/gx' failed: exit status 2
exit status 1
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/code/go"
GOPROXY=""
GORACE=""
GOROOT="/snap/go/3129"
GOTMPDIR=""
GOTOOLDIR="/snap/go/3129/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmess age-length=0 -fdebug-prefix-map=/tmp/go-build084141052=/tmp/go-build -gno-record -gcc-switches"
root@vultr:~# ls
code go go1.11.4.linux-amd64.tar.gz snap
Anybody know how to fix it fatal error: stdlib.h ?
@travisperson, do you mind taking this one?
@zjoooooo thats a weird one... do you have gcc or clang installed?
@whyrusleeping Yes, I already install gcc.
This issue may be stale from the previous release. @zjoooooo did you resolve your problem?
OS X Mojave moved the location of stdlib.h out of /usr/include. This issue exists for other packages and there are several possible solutions suggested in this thread for neovim issue #9050. Thanks to Filecoin community member A_jinbin_filecoin.cn for the link.
I think this issue has gone stale, particularly since we have moved to go modules from gx so the original case is not longer reproducible. Please re-open with a new reproduction if this is incorrect.
I saw the same error in Ubuntu 18.04:
_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory
and doing sudo apt install --reinstall build-essential resolved the error for me.
I saw the same error in Ubuntu
18.04:_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directoryand doing
sudo apt install --reinstall build-essentialresolved the error for me.
good
I saw the same error in Ubuntu
18.04:_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directoryand doing
sudo apt install --reinstall build-essentialresolved the error for me.
this resolved my the same problem on Linux mint 19
I saw the same error in Ubuntu
18.04:_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directoryand doing
sudo apt install --reinstall build-essentialresolved the error for me.
good , this resolved my the same problem on linux mint 20.
I had the same issue. When I installed musl-dev, the problem was solved in alpine
Most helpful comment
I saw the same error in Ubuntu
18.04:and doing
sudo apt install --reinstall build-essentialresolved the error for me.