AzureAD/microsoft-authentication-extensions-for-go

Building on Linux doesn't work

mjnovice opened this issue · 1 comments

If I try to build my client on linux it breaks

env GOOS=linux GOARCH=amd64 go build -o cliamd64
# github.com/UiPath/Tetris/cmd/cli/client
client/create.go:81:33: undefined: msalAccessor.New

while it works on macOS. Any reasons why ?

The Linux build (also) requires cgo and a platform specific toolchain:

#cgo LDFLAGS: -ldl
#include <dlfcn.h>
#include <stdlib.h>

That error suggests you're building with CGO_ENABLED=0 but setting it to 1 isn't necessarily enough to build--you need the toolchain in any case.