user267298
user267298

Reputation: 139

How to link hdf5 c++ (MAC)

I'm pretty new to c++ and I'm trying to figure out how to link hdf5 with my Mac. I've brew install hdf5, however when I try to include the header file: #include "H5Cpp.h" in my c++ code I get an error that says "No such file or directory".

How do I help c++ find the hdf5 installation?

Upvotes: 1

Views: 890

Answers (1)

user267298
user267298

Reputation: 139

As @273K said (the header file from home-brew are located in /usr/local/include/: so this works:

g++ -I /usr/local/include main.cpp

Where main.cpp has the line:

#include "H5Cpp.h"

Upvotes: 1

Related Questions