Have you already checked for another declaration in sm_sdk.h?
btw which go version are you on? The error message doesn't seem like the 
latest release. 

Also can you provide a self contained buildable example and build commands?

On Friday, 13 April 2018 12:45:39 UTC+8, r...@soulmachines.com wrote:
>
>
> So I am try to get a simple CGO program going with a GO function that can 
> get called back from a 'C' library
>
> the error I get is 
>
> In file included from _cgo_export.c:3:
> cgo-gcc-export-header-prolog:42:14: error: conflicting types for 
> '_go_Callback'
> src/smsdk/go_bindings.go:12:12: note: previous declaration is here
> _cgo_export.c:17:7: error: conflicting types for '_go_Callback'
> src/smsdk/go_bindings.go:12:12: note: previous declaration is here
>
> The code is simple looks like this
>
> package smsdk
>
> /*
> #cgo CFLAGS: -Damd64 -D SM_SDK_INTERNAL -I ${SRCDIR}/smsdk
> #cgo LDFLAGS: -L${SRCDIR} -lsm_sdk
> #include <stdbool.h>
> #include <stdlib.h>
> #include "sm_sdk.h"
>
> extern int _go_Callback(int speaking_state);
>
> static void Callback(Handle h, void * caller_context)
> {
> int val = CLibraryFunction(h);
> _go_Callback(val);
> }
> */
> import "C"
> import (
> "unsafe"
> "sync"
> )
>
> var _registeredCallback func(int)
>
> //export _go_SpeakingStateCallback
> func _go_SpeakingStateCallback(val int) int {
>
> if _registeredCallback != nil {
> _registeredCallback(val)
> return 1
> }
> return 0
> }
>
> Any suggestions? 
>
> ------------------------------
>
> "This communication is confidential and may contain privileged and/or 
> copyright material. If you are not the intended recipient you must not use, 
> disclose, copy or retain it. If you have received it in error please 
> immediately notify me by return email, delete the emails and destroy any 
> hard copies. Soul Machines Limited does not guarantee the integrity of this 
> communication, or that it is free from errors, viruses or interference."
>
> *Please consider the environment before printing this email.*
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to