I made the original post below but think the question can be made more general.
I installed a c++ library called ibex. It contains a file ibex.h and a subfolder ibex, and the subfolder contains more header files that are called by ibex.h. Both ibex.h and the subfolder are located in /usr/local/include. I have confirmed this is in my standard system directory.
I'm trying to run the example code from ibex's website below called foo.cpp
#include <ibex.h>
#include <iostream>
using namespace std;
using namespace ibex;
int main(int argc, char** argv) {
Interval x(0,1);
cout << "My first interval:" << x << endl;
}
but get the error
In file included from (filelocationremoved)/foo.cpp:1:
/usr/local/include/ibex.h:6:10: fatal error: 'ibex_Setting.h' file not found
So basically it can find ibex.h but won't look in the subfolder for ibex_Setting.h (or any of the other files in the subfolder). Is there a way to get it to view all the files in that subfolder as if they are in the /usr/local/include folder without moving them all in?
Thanks!
Original post:
I'm a novice c++ user (I mostly use Matlab and a little Python) but need to use c++ for the ibex library (http://www.ibex-lib.org). I'm trying to get their basic example to compile but am having issues. I'm hoping some of the experienced users here can help as I'm making no progress.
Notes:
- Running MacOS Catalina
- Using Sublime text for my IDE
- I have Xcode installed and can run a hello world example
- Installed ibex using:
brew install ibex
I am trying to run the following example code from their documentation called foo.cpp
#include <ibex.h>
#include <iostream>
using namespace std;
using namespace ibex;
int main(int argc, char** argv) {
Interval x(0,1);
cout << "My first interval:" << x << endl;
}
but get the error
In file included from (filelocationremoved)/foo.cpp:1:
/usr/local/include/ibex.h:6:10: fatal error: 'ibex_Setting.h' file not found
The ibex_Setting.h file is one of the many files called by ibex.h. I have the ibex.h file located in /usr/local/include and it seems to be able to find it. I also have an alias of the ibex folder (where all the relevant subfiles are located) in the same /usr/local/include folder. But it won't look in that subfolder. That subfolder was created by brew link ibex
, which I assume is supposed to make it findable. If I move ibex_Setting.h into the /usr/local/include folder, it then finds it, but moves to the next file it can't find (also located in /usr/local/include/ibex). The folder has enough files that I don't want to manually move all of them into /usr/local/include. Also, that would seem silly to need to do that.
In the ibex documentation, it also says to do this:
export DYLD_LIBRARY_PATH=[prefix]/lib
, where prefix is the folder location. My libibex.dylib is located in /usr/local/lib, which I used. This did not help. I'm sure I'm not providing enough information, but again I'm new to c++ so don't even know what else to include. Any help would be greatly appreciated!
Thanks