Thank you
It did work .
Build go code as a static c lib ,and go code also link another c lib.
在 2017年4月19日星期三 UTC+8上午9:04:37,Ian Lance Taylor写道:
>
> On Tue, Apr 18, 2017 at 6:01 PM, hui zhang > wrote:
> >
> > C functions have to be available when the Go package is built.
> > yes, but
On Tue, Apr 18, 2017 at 6:01 PM, hui zhang wrote:
>
> C functions have to be available when the Go package is built.
> yes, but static lib is kind of definition.
>
> //#cgo CFLAGS: -I
> //#cgo CXXFLAGS="${CFLAGS}"
> //#cgo LDFLAGS: -L -l
>
> will this above work ? if I want to build a go stati
C functions have to be available when the Go package is built.
yes, but static lib is kind of definition.
//#cgo CFLAGS: -I
//#cgo CXXFLAGS="${CFLAGS}"
//#cgo LDFLAGS: -L -l
will this above work ? if I want to build a go static lib?
> how about go call c wrapper function , c wrapper fun
On Tue, Apr 18, 2017 at 1:37 AM, hui zhang wrote:
> add a c wrapper around cfunc.h not help either.
>
> 在 2017年4月18日星期二 UTC+8下午4:36:26,hui zhang写道:
>>
>> I want to embedded go code in c/c++ program.
>> my approach as below, however go code can not be compiled
>> C main() --> go func --> c func
add a c wrapper around cfunc.h not help either.
在 2017年4月18日星期二 UTC+8下午4:36:26,hui zhang写道:
>
> I want to embedded go code in c/c++ program.
> my approach as below, however go code can not be compiled
> C main() --> go func --> c func(in static lib)
>
>
> **
> #include "libgofunc.h"
> int main