Greetings,
I’m maintaining a desktop API where the deploy is basically a binary library (one for each OS: Windows, Linux and Mac).
At this time, does Go is able to create such libraries during compile time ?
Cheers
Greetings,
I’m maintaining a desktop API where the deploy is basically a binary library (one for each OS: Windows, Linux and Mac).
At this time, does Go is able to create such libraries during compile time ?
Cheers
Short answer: yes.
Long answer: yes, but there are a couple of things to be aware of, both on the Go side and the C side.
A short introduction to creating shared C libraries in Go can be found here and a longer one here. (Found by searching Google for go dynamic library
.)
go build -buildmode=c-archive github.com\user\ExportHello
+++++++++++++
====>golang will build ExportHello.a, ExportHello.h
++++++++++++++++++++++++++++++++++++++
compile with gcc and generate dll
++++++++++++++++++++++++
gcc -shared -pthread -o Hello2.dll Hello2.c ExportHello.a -lWinMM -lntdll -lWS2_32
+++++++++++++++
and generate Hello2.dll
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.