New to GoLang so go easy on me. I installed this package for which are GO bindings for the HDF5s filesystem:
go get github.com/sbinet/go-hdf5
and I get
fatal error: hdf5.h: No such file or directory
// #include "hdf5.h"
the file hdf5.h (which comes from the original hdfs library, not the go package) is located in
usr/include/hdf5s/series
how do I tell the go compiler to look in the /user/include/hdf5s/series directory for this header file?
Go does not use header files. Instead, each source file is part of a defined package. When a package defines an object (type, constant, variable, function) with a name starting with an upper case letter, that object is visible to any other file which imports that package. Go does not support implicit type conversion.
Most standard headers are stored in /usr/include . It looks like stdbool. h is stored somewhere else, and depends on which compiler you are using. For example, g++ stores it in /usr/include/c++/4.7.
The header file eliminates the labor of finding and changing all the copies as well as the risk that a failure to find one copy will result in inconsistencies within a program. In C, the usual convention is to give header files names that end with . h .
To make a header file, we have to create one file with a name, and extension should be (*. h). In that function there will be no main() function. In that file, we can put some variables, some functions etc.
Pass the -I
flag to the C compiler using the CGO_CFLAGS
environment variable (documentation):
CGO_CFLAGS="-I/usr/include/hdf5s/series" go get -u github.com/sbinet/go-hdf5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With