I am trying to use a library downloaded from the IRIS website. The makefile includes options to create dynamic and static libraries. I have tried a couple tutorials out there using both types of library with cgo and I have been unsuccessful.
Here is my go code
package main
/*
#cgo CFLAGS : -I .
#cgo LDFLAGS: -L . -llibslink
#include <libslink.h>
*/
import (
"C"
)
func main() {
C.sl_newslcd()
}
And I have the following files in the directory:
ChangeLog config.o globmatch.o logging.c slplatform.c strutils.c
Makefile doc gswap.c logging.o slplatform.h strutils.o
Makefile.wat example gswap.o main.go slplatform.o unpack.c
Makefile.win genutils.c libslink.2.4.dylib msrecord.c slutils.c unpack.h
README genutils.o libslink.a msrecord.o slutils.o unpack.o
README.md globmatch.c libslink.dylib network.c statefile.c
config.c globmatch.h libslink.h network.o statefile.o
My error messages are as follows on the command: go build -v main.go
command-line-arguments
# command-line-arguments
37: error: use of undeclared identifier 'SLCD'
37: error: use of undeclared identifier 'sl_newslcd'