On Sun, Oct 31, 2021 at 10:17 AM Elemer Pixard <elp...@gmail.com> wrote:
>
> I am developing a binding to a C++ library
> using a wrapper module (using extern "C" directive).
> The C++ library files are in a subdirectory of the package.
>
> If I create a file in the package directory such as:
>
> lib.cpp
> --------------
> #include "cpplib/file.cpp"
> #include "cpplib/wrapper.cpp"
> --------------
>
> It works, but if I create a Go file instead such as:
>
> lib.go
> --------------
> package lib
>
> // #include "cpplib/file.cpp"
> // #include "cpplib/wrapper.cpp"
> import "C"
> ...
> --------------
>
> This doesn't compile because cgo uses gcc instead of g++.
> I would prefer this second way because I need to
> configure the build using tags.
> Is there a way to solve this ?

There is no way to get this to work using #include "cpplib/file.cpp"
in the cgo comment.

I don't understand why the lib.cpp approach doesn't work, though.  You
say that it needs tags, but what tags does it need?

Ian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVHpAeT9Gtq%2B0Kx2xFva2dHYDWnZC1dhzax223sEgL-GQ%40mail.gmail.com.

Reply via email to