Closed LJ1102 closed 10 months ago
Not able to reproduce. I checked out a fresh repo and copy-pasted your command to console & it passes without errors (Windows 10).
What version of go you have? I'm on 1.20.2 windows/amd64.
The latest Windows binaries, including vsti & native-vsti, can also be downloaded from here too: https://github.com/vsariola/sointu/suites/14455682343/artifacts/816237188
They are always built as part of actions.
Oh, sointu has been pointing to a particular latest commit in the vst2. I think if you go get -u pipelined.dev/audio/vst2
it points the vst2 to the latest tag, but I had to send some pull requests to vst2 to make sointu work with & they were merged to master, yet I don't think sergej has published a new tag with the changes. So, I think something like go get -u pipelined.dev/audio/vst2@master
might be a better idea.
And samples do not work on the "non-native" version of the tracker/vsti; it has to be the native version. Someday, I'll fix this, but this is issue #75.
Still getting the same error after getting master of vst2, according to go version
I'm also 1.20.2
. I'm fine with using the prebuild package though.
I have the problem as well (on Windows). The commands above do not solve it. Will investigate a little
I have updated the README.md to reflect the need for the environment variable CGO_ENABLED=1, closing this for now
Clarification: the root cause of this is that cgo compatible compiler e.g. gcc is missing, along with PATH or CC environment variable pointing to that compiler. Golang tries to find the C-compiler, but being unable to find it, automatically considers CGO_ENABLED=0. When this happens, all files that include C-code are just excluded from the build, resulting in missing types.
Forcing CGO_ENABLED=1 is a good idea, as it gives better error messages of the root cause (missing compiler).
Relevant documentation: https://pkg.go.dev/cmd/cgo
The crucial paragraph:
The cgo tool is enabled by default for native builds on systems where it is expected to work. It is disabled by default when cross-compiling as well as when the CC environment variable is unset and the default C compiler (typically gcc or clang) cannot be found on the system PATH. You can override the default by setting the CGO_ENABLED environment variable when running the go tool: set it to 1 to enable the use of cgo, and to 0 to disable it. The go tool will set the build constraint "cgo" if cgo is enabled. The special import "C" implies the "cgo" build constraint, as though the file also said "//go:build cgo". Therefore, if cgo is disabled, files that import "C" will not be built by the go tool. (For more about build constraints see https://golang.org/pkg/go/build/#hdr-Build_Constraints).
Tried to build the VST2 plugin using the command line from the readme and getting the following output:
installed the VST2 thing(https://github.com/pipelined/vst2) using
go get -u pipelined.dev/audio/vst2
and rerunning the build, same output.Building the standalone tracker using
go build -o sointu-track.exe cmd/sointu-track/main.go
worked just fine, except that the GM samples are not playing on my system (Windows 10).