Unable to start debugger on OSX

I am trying to debug a Go application in Goland 2018.2.2.OSX Mojave.


When running the debugger I get the following error:

# runtime/cgo
_cgo_export.c:3:10: fatal error: 'stdlib.h' file not found

Any ideas what could be causing this?



The error certainly looks like a problem with your xcode installation. It looks like your C compiler can not find the standard header files.


yes, i managed to solve this back then. i think i posted the solution somewhere too but forget and cannot find it. this post seems related:


there was some trickery needed to get the latest macos version to include the correct files. some legacy headers from their viewpoint or so.

in any case, the debugger does not work so well even after fixing this, but at least some things can be debugged. it hangs on the scanf() commands to read command line input. there are several issues on that in the goland issue tracker and with the delve backend itself.

hope it gets better. such a shame for a very nice programming language such as go to lack good support for some basic debugging.



Please sign in to leave a comment.