Hello, I tried your example and I got
"c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
$WORK\b001\_x002.o: in function `_cgo_d32036b73474_Cfunc_print':
/tmp/go-build/cgo-gcc-prolog:49: undefined referen
On Thu, Apr 11, 2019 at 5:54 PM av wrote:
> Hi *,
>
> I want to compile C++ code, because the library I need is C++ only.
>
> Here is my wrapper.hpp:
> #include
>
> void print() {
> std::cout << "Xx";
> }
>
> And here is my main.go:
> package main
>
> // #cgo CXXFLAGS: -I.
> // #cgo CFLAGS: -I
Hi *,
I want to compile C++ code, because the library I need is C++ only.
Here is my wrapper.hpp:
#include
void print() {
std::cout << "Xx";
}
And here is my main.go:
package main
// #cgo CXXFLAGS: -I.
// #cgo CFLAGS: -I.
// #cgo LDFLAGS:
// #include "wrapper.hpp"
import "C"
func main() {