From: Alexander Sun <daetalusun@gm...> - 2013-03-12 14:43:48
I want to use port c/c++ to go through swig. With the official
tutorial's help, I had succeed on Linux.
But on Windows, there have some problems. First I try to use MSVC, but
didn't work. The detail is
Then I move to the mingw. For example, now I have test.i and test.c.
Then use the command like this:
$ swig -go -windows test.i
test.c test.go test.i test_gc.c test_wrap.c
$ gcc -c test.c test_wrap.c
$ gcc -shared test.o test_wrap.o -o test.dll -lcgo
The problem is here: "libcgo.a: file not recognized: File format not recognized"
The cgo.a was in Go/pkg/runtime/cgo, and I change the name to libcgo.a .
How to fix the mingw problem? If anyone can help me to solve the MSVC
problem are also welcome!
Thanks! (English is not my native language, so sorry for the grammer