module
Version:
v0.0.0-...-ad32c61
Opens a new window with list of versions in this module.
Published: Jul 20, 2019
License: MIT
Opens a new window with license information.
README
¶
golang-ui
Sandbox for Golang UI
Enabling CGO on Windows
- Install MSYS2 64 bit (msys2-x86_64)
- Update (See here)
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))
}
Caveat
Cross-compiling
(eg. building 32-bit .exe on 64-bit Windows with CGO)
is not working.
Directories
¶
|
|
|
|
|
|
|
|
|
|
Demo code for the Form primitive.
|
Demo code for the Form primitive. |
|
|
|
|
Click to show internal directories.
Click to hide internal directories.