janh / go-dsl

Library and application for reading xDSL stats
Mozilla Public License 2.0
31 stars 2 forks source link

build failure of dsl-gui on macos monterey with go 1.19.4 #9

Closed moeller0 closed 1 year ago

moeller0 commented 1 year ago

I seem to run into some issue when building dsl-gui (the CLI version compiles just fine)

bash-3.2$ go build -o dsl ./cmd
bash-3.2$ go build -tags gui -o dsl-gui ./cmd
# github.com/webview/webview
../../../go/pkg/mod/github.com/webview/webview@v0.0.0-20230102133235-36bbd1c79ac6/webview.go:15:10: fatal error: 'stdlib.h' file not found
#include <stdlib.h>
         ^~~~~~~~~~
1 error generated.
bash-3.2$ go version
go version go1.19.4 darwin/amd64

This is probably a pilot's error from my side, but maybe you have an idea how I could fix this?

janh commented 1 year ago

It looks like this issue usually occurs when using a compiler other than the one from Xcode (as a result of headers no longer being installed to /usr/include for some time now). Maybe the comments on the issues https://github.com/golang/go/issues/39232 and https://github.com/golang/go/issues/27921 are useful to solve it?

moeller0 commented 1 year ago

Ah, one other package (FSL) I installed dragged in its own clang and "helpfully" added itself earlier in the path. Sorry for the confusion and thanks for the help. Now how do I fix this....

moeller0 commented 1 year ago

Yepp, I needed to modify my PATH to put /usr/bin before the offending application's path. A solution shown in your links, so I am closing this, as you solved it even though it was my own un-doing.... ;)