Hi *,

I have following C++ code:

wrapper.hpp:

#include <iostream>

void printSomething() {
  printf("Hello World");
}

And corresponding main.go:

package main

// #cgo CXXFLAGS: -I.
// #cgo CFLAGS: -I.
// #cgo LDFLAGS:
// #include "wrapper.hpp"
import "C"

func main() {
        C.print()
}

Unfortunately the result of "go build ." is:

# _/home/avalchev/Sources/apt
In file included from ./main.go:6:0:
./wrapper.hpp:1:20: fatal error: iostream: No such file or directory
 #include <iostream>
                    ^
compilation terminated.


Basically I'm trying to create debian's libapt-pkg wrapper, but the only 
workaround I tried (and it works) is to create static library, but this 
reduces portability a lot.

Is there any way to make this work ?

 
 


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to