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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.