golang-ui

module
v0.0.0-...-ad32c61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2019 License: MIT

README

golang-ui

Sandbox for Golang UI

Enabling CGO on Windows

  1. Install MSYS2 64 bit (msys2-x86_64)
  2. Update (See here)
  • pacman -Syu
  • pacman -Syuu
  • pacman -Su
  • many times
  1. Install gcc (See here)
  • pacman -S mingw-w64-x86_64-gcc
  • pacman -S mingw-w64-i686-gcc for 32 bit version
  1. Add to PATH
  • C:\msys64\mingw64\bin
  • C:\msys64\usr\bin
  1. ...
  2. 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))
}
Caveat

Cross-compiling (eg. building 32-bit .exe on 64-bit Windows with CGO) is not working.

Directories

Path Synopsis
Demo code for the Form primitive.
Demo code for the Form primitive.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL