Re: [go-nuts] swig and go: cxx generation fail - No such file or directory for #include .h file

30 views
Skip to first unread message

Ian Lance Taylor

unread,
Jun 23, 2017, 5:37:27 PM6/23/17
to jkl...@ucdavis.edu, golang-nuts
On Fri, Jun 23, 2017 at 11:27 AM, <jkl...@ucdavis.edu> wrote:
>
> I'm using go version 1.7.4 on linux/amd64 and trying to run go build on a
> .swigcxx file. I also have a .go file that has the package name and string:
> import "C"
> package mdm
>
>
> import "C"
>
>
>
> My .swigcxx file is trying to include a library and methods from this
> library:
> %module mdm
> ${
> #include "IfxMetrics.h"
> %}
>
>
> int IfxStartup();
> void IfxCleanup();
> ....
>
>
>
> when I run "go build" or "go build -x" I get the error:
> ./mdm_wrap.cxx fatal error: IfxMetrics.h: No such file or directory
>
> #include"IfxMetrics.h"
>
> I tried adding flags to my .go file the path to the IfxMetrics library like
> so:
>
>
> // #cgo CFLAGS: -I<path to library folder>
> // #cgo CXXFLAGS: -I<path to library folder>
>
>
> but that doesn't work. Am I missing a step or some flag?

I would have expected that to work. Can you show us your complete .go file?

Ian
Reply all
Reply to author
Forward
0 new messages