How to export function from different package of go into static library so that I can call it from a cpp program

Viewed 40

I have a main package and a string package in go.

In main.go (main package)I have one //export function and

In string.go(string package) I have another //export function.

When I run "go build -buildmode=c-archive" I see that the header file generated has only declaration of main package functions and it does not include any //export functions from string package.

Any suggestion would be helpful. Thanks in advance.

0 Answers
Related