Skip to content

gfapi.Volume not defined error when attempting to cross compile #32

@chrisbecke

Description

@chrisbecke

Problem

Building the sample main.go from the README.md on MacOS I get the following result:

$ go build
# pkg-config --cflags  -- glusterfs-api glusterfs-api glusterfs-api
Package glusterfs-api was not found in the pkg-config search path.
Perhaps you should add the directory containing `glusterfs-api.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glusterfs-api' found
Package glusterfs-api was not found in the pkg-config search path.
Perhaps you should add the directory containing `glusterfs-api.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glusterfs-api' found
Package glusterfs-api was not found in the pkg-config search path.
Perhaps you should add the directory containing `glusterfs-api.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glusterfs-api' found
pkg-config: exit status 1

Ok. It seems that glusterfs-api is not available natively for Mac. Perhaps I can try cross compile the binary for a linux image:

$ GOOS=linux GOARCH=amd64 go build
# main 
./main.go:6:10: undefined: gfapi.Volume

Steps to replicate

  1. a test go project was created as per the instructions on github.com/gluster/gogfapi
  2. GOOS=linux GOARCH=amd64 go build was executed to do the build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions