question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

-buildmode=c-shared not supported on windows/amd64

See original GitHub issue

Im using go 1.9.3 and just tried to do this with this simple file :

package main

import "C"
import (
	"fmt"
)

//export add
func add(a, b int) int {
	var sum int = a + b
	fmt.Println("DONE")
	return sum
}

func main() {}

But kept getting the error above. Is there any way to fix this? Am I using the wrong command?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SommerEngineeringcommented, Oct 23, 2018

Since Go 1.10, it works also with Windows. Thus, this issue could be closed.

0reactions
fameicommented, Sep 8, 2022

图片 图片 图片 我的 go 1.19 也有同样的问题,我应该怎么解决

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Builmode on Windows - Getting Help - Go Forum
Hi, I'm trying to build a go shared lib. under Windows x64, but each time I do ... I get -buildmode=shared not supported...
Read more >
Support for -buildmode=shared on darwin/amd64
Are there any plans to support -buildmode=shared for platform darwin/amd64 ? > Or possible timeframe / target version of language ? I'm not...
Read more >
go "-buildmode=c-shared" compiled DLL is not working on ...
I compiled for windows/amd64 with following command: go build -o add.dll -buildmode=c-shared ./add.go. The compilation generates add.dll, ...
Read more >
go command - cmd/go - Go Packages
Supported only on linux/amd64, linux/arm64 and only with Clang/LLVM as the ... be linked against shared libraries previously created with -buildmode=shared.
Read more >
src/cmd/go/build.go - go - Git at Google
The '.exe' suffix is added when writing a Windows executable. ... fatalf("-buildmode=shared not supported on %s\n", platform). } codegenArg = "-dynlink".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found