5

I built my .so file:

go build -buildmode=plugin -o test.so

and run debug with Goland, then I get the error:

Error running agent: could not initialize input inputs.plugin_input: plugin.Open("./plugins_lib/test1"): plugin was built with a different version of package runtime/internal/sys

But I can build my main program in my terminal and it will work well.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
hxysayhi
  • 1,888
  • 18
  • 25

1 Answers1

8

The plugin should be compiled with the same flags as the main application.

If the application is compiled using the IDE already, then add the -gcflags="all=-N -l" to the above go build ... command.

go build -buildmode=plugin -gcflags="all=-N -l" -o test.so

In addition,if the IDE is Goland, the build command of the main application can be found at the debug console of Goland.

hxysayhi
  • 1,888
  • 18
  • 25