Works like charm. Thanks a lot.
Here is my code:
aptwrap.h
#ifdef __cplusplus
extern "C" {
#endif
void print();
#ifdef __cplusplus
}
#endif
aptwrap.cpp
#include "aptwrap.h"
#include
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
void print() {
std::cout << "
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() {