ollevche / goshlib

How to build a shared library (.dll) in Go for Windows on Ubuntu?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goshlib - Go Shared Library Example

This is an example of how to build shared libraries (.dll, .so) in Go and C using Linux.

You have to install x86_64-w64-mingw32-gcc compiler to build a shared library for Windows (.dll).

Makefile has had targets for building libraries (Go, C) and a client app as an example. Here is how you can try it:

Target Action
make (all) builds Go and C .so libraries, the client app, then runs the app
make run runs the app
make usego / make usec swaps the shared library for Go / C
make win builds Go and C .dll libraries for Windows
make clean deletes object files
make fclean deletes object files, binaries and libraries
make re make fclean + make (all)

Useful resources

About

How to build a shared library (.dll) in Go for Windows on Ubuntu?

License:MIT License


Languages

Language:Makefile 71.3%Language:Go 16.8%Language:C 11.9%