I ran into the same problem.  in one of my go file, I have: 

//#cgo CFLAGS: -I/usr/include/libnl3
/*
#include <netlink/netlink.h>



However, when I try to build, I got the following error: ( I have 
libnl-3-dev, libnl-genl-3-dev installed and the netlink/netlink.h file is 
at /usr/include/libnl3/ directory. netlink.h file does include some other 
header files like
 #include <sys/somefile.h>
#include <Linux/some.h>
#include <netlink/other.h>    --> The same directory as "netlink/netlink.h" 
file


+ go install -gcflags '' -ldflags ' -X 
k8s.io/kubernetes/pkg/version.buildDate=2016-11-18T06:14:04Z -X 
k8s.io/kubernetes/pkg/version.gitCommit=a26530bfce8126450e4ad0faab222046ce0953f3
 
-X k8s.io/kubernetes/pkg/version.gitTreeState=dirty -X 
k8s.io/kubernetes/pkg/version.gitVersion=v1.1.0-alpha.1.16011+a26530bfce8126-dirty
 
-X k8s.io/kubernetes/pkg/version.gitMajor=1 -X 
k8s.io/kubernetes/pkg/version.gitMinor=1+' k8s.io/kubernetes/cmd/kubelet 
k8s.io/kubernetes/cmd/kubemark k8s.io/kubernetes/cmd/hyperkube 
k8s.io/kubernetes/cmd/gendocs k8s.io/kubernetes/cmd/genkubedocs 
k8s.io/kubernetes/cmd/genman k8s.io/kubernetes/cmd/genyaml 
k8s.io/kubernetes/cmd/mungedocs k8s.io/kubernetes/cmd/genswaggertypedocs 
k8s.io/kubernetes/cmd/linkcheck 
k8s.io/kubernetes/examples/k8petstore/web-server/src 
k8s.io/kubernetes/federation/cmd/genfeddocs 
k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/ginkgo
# k8s.io/kubernetes/vendor/github.com/google/seesaw/netlink
vendor/github.com/google/seesaw/netlink/cfuncs.go:19:29: fatal error: 
netlink/netlink.h: No such file or directory
 #include <netlink/netlink.h>
                             ^
compilation terminated.



On Friday, July 19, 2013 at 1:37:27 PM UTC-7, john...@gmail.com wrote:

> I'm trying to build an interface for the Swiss Ephemeris package. So far, 
> I've got the original compiled to both a .a and a .so, and I've moved the 
> two header files I need into the same directory as the .go file. I've also 
> stuck the .a (but not the .so) into pkg/darwin_amd64.
>
> Here's the source:
>
> // swephint is the interface to the Swiss Ephemeris: see the Swiss 
> Ephemeris documentation
> // for copyright information.
>
> package swephint
>
> /*
>
> #cgo LDFLAGS: -llibswe
>
> #import "swephexp.h"
>
> */
> import "C"
> import "unsafe"
>
> func SetEphPath(path string) {
>     cpath := C.CString(path)
>     defer C.free(unsafe.Pointer(cpath))
>         C.swe_set_ephe_path(cpath)
> }
>
> This is an almost direct copy from the cgo article.
>
> What's happening is:
>
> jhrothjr:src johnroth$ go install swephint
> # swephint
> ld: library not found for -llibswe
> collect2: ld returned 1 exit status
>
> I've already tried using -L for the directory where the .a and .so were 
> originally compiled to. It also doesn't seem to make any difference whether 
> I say -llibswe or -llibswe.a
>
> As you might guess, I'm a relative novice in unix-style development tools.
>
> Any ideas? Thanks in advance
>
> Thanks.
>

-- 
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