Go compile problem

I got a problem when I try to compile my go program in windows


c:/mingw/bin/…/lib/gcc/mingw32/4.9.3/…/…/…/…/mingw32/bin/ld.exe: cannot find -ldl
collect2.exe: error: ld returned 1 exit status

Is my gcc path got any problem?

i don’t understand what do you try to do with gcc here… if you set correct GOPATH and PATH in your environment, simply do
go build
in your project directory. that’s all folks.

when I try to build my go program, I got this error “c:/mingw/bin/…/lib/gcc/mingw32/4.9.3/…/…/…/…/mingw32/bin/ld.exe: cannot find -ldl”.
But the “id.exe” is in “c:/mingw/bin”. So why I still get this error?

It’s looking for a library called “dl”, not the linker (ld). Your program apparently uses cgo. That’s not really Go as such, so you’ll have to investigate what it is you’re attempting to build and the requirements for it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.