Hi *,
I want to compile C++ code, because the library I need is C++ only.
Here is my wrapper.hpp:
#include <iostream>
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() {
C.print()
}
The output of "go build" is:
In file included from ./main.go:6:0:
./wrapper.hpp:1:20: fatal error: iostream: No such file or directory
#include <iostream>
^
compilation terminated.
I can make this work by using Makefile and static library, but this reduce portability significantly.
Basically I want to create libapt-pkg wrapper, but I don't want to introduce another debian package for the wrapper.
Do you have any idea how to make this work?