runtime/cgo: Invalid parameter created and passed by cgo into cl: invalid numeric argument '/Werror' #64695
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Go version
go version go1.21.5 windows/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Installed go 1.21.5 using the msi installer: go1.21.5.windows-amd64.msi.
Then set CC=cl, set CC=cl inside a Developer Command Prompt for VS2022 -NOT powershell-.
main.go:
package main
/*
##cgo LDFLAGS: -L${SRCDIR}/build/Release -lappemitterlib
#include "Emitter.hpp"
*/
import "C"
import "fmt"
func main() {
// Call the C function
C.MySingleton_myPublicMethod()
}.
Tried to run this using go run main.go
What did you expect to see?
Some random line printed by the c++ function.
Then
"Called C++ function from Go"
What did you see instead?
runtime/cgo
Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32824 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line error D8021 : invalid numeric argument '/Werror'
The text was updated successfully, but these errors were encountered: