Sandbox for Golang UI
pacman -Syu
pacman -Syuu
pacman -Su
- many times
- Install
gcc
(See here)
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-i686-gcc
for 32 bit version
- Add to PATH
- C:\msys64\mingw64\bin
- C:\msys64\usr\bin
- ...
- PROFIT!
package main
/*
#include <stdio.h>
#include <stdlib.h>
void myprint(char* s) {
printf("%s\n", s);
}
*/
import "C"
import "unsafe"
func main() {
cs := C.CString("Hello from stdio\n")
C.myprint(cs)
C.free(unsafe.Pointer(cs))
}
Cross-compiling (eg. building 32-bit .exe on 64-bit Windows with CGO) is not working.