On Tue, 21 Mar 2017 11:23:39 +0300
Konstantin Khomoutov wrote:
[...]
Sorry, a couple of assorted fixes:
> A sketch would look something like this:
>
> /*
> typedef MediaHandle uint64_t
Should be
typedef uint64_t MediaHandle
of course.
> */
> import "C"
>
> import "unsafe"
>
On Mon, 20 Mar 2017 06:25:01 -0700 (PDT)
Song Liu wrote:
[...]
> struct Media {
>
> char*Name;
>
> char*Path;
>
> uint64_t Size;
>
> };
[...]
> func GetMediaFromDB(filename *C.char) *C.struct_Media {
>
>
> c_struct_media := &C.struct_Media{}
>
>
> return c_stru
Thanks for your info, it seems that it's reporting the same error but still
not have a solution.
After tried to use unsafe:
return (*C.struct_Media)(unsafe.Pointer(c_struct_media))
it reports same error:
panic: runtime error: cgo result has Go pointer
Any further insights about this issue? ma
The following may help:
http://feisky.xyz/2016/04/19/cgo-in-go-1-6/
On 20/03/2017 13:25, Song Liu wrote:
Hi,
I have a shared lib as bellow:
|
/*
#include
structMedia{
char*Name;
char*Path;
uint64_tSize;
};
*/
import"C"
//exportGetMediaFromDB
funcGetMediaFromDB(filename*C.char)*C.struct_Media{
Hi,
I have a shared lib as bellow:
/*
#include
struct Media {
char*Name;
char*Path;
uint64_t Size;
};
*/
import "C"
//export GetMediaFromDB
func GetMediaFromDB(filename *C.char) *C.struct_Media {
c_struct_media := &C.struct_Media{}
return c_struct_med