Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package cgopkg
//#include <stdlib.h>
//#include "cgopkg.h"
import "C"
import (
func Foo() {
chi := C.CString("hi")
void fooprint(char* s)
#include <stdio.h>
void fooprint(char* s) {
printf("%s\n", s)
/*Compile errors*/cgopkg.go:13:9: unable to find value of constant C.CString
cgopkg.go:13:9: call of non-function C.CString
cgopkg.go:14:8: unable to find value of constant
cgopkg.go:14:8: call of non-function
cgopkg.go:15:2: unable to find value of constant C.fooprint
cgopkg.go:15:2: call of non-function C.fooprint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.