Question

I am trying to solve a coupled set of ODE's in C++, and I have decided that I want to try out odeint (available here) as I have read many good things about it. However I am having compiling the examples that are included in the package. Here is the situation:

So far I have only downloaded the package and extracted it. I am running Visual C++ 6 on Windows XP and I am compiling the example "simple1d". I get the error message: "Cannot open include file: 'boost/config.hpp': No such file or directory".

It is not clear to me what I am missing. Do I need the full boost library to make this work? I was under the impression that ODEINT is a "standalone" package.

Was it helpful?

Solution

Your error says that compiler can not find the boost libraries. You should download them from boost.org and also add them to your header path.

OTHER TIPS

Where did you download and extract the package to? The package homepage says that it's a header-only package, so you only need to let Visual find the header files. I haven't used Visual in a while, but a quick google of something like "Visual 6 add header path" should be a good place to start. Take a look at Where does Visual Studio look for C++ header files?.

Quoting from this page:

Within Visual Studio, go to the Project Settings dialog. We want to change the settings for both Debug and Release versions, so under the Settings For field, select "All Configurations". Under the C/C++ Tab, select Preprocessor options.

The package tarball has a directory called boost: you want to add the path of that directory into the Additional include directories box and then #include <boost/numeric/odeint/config.hpp> in your code.

Update

It appears, then, that you already have the odeint headers installed properly: the file boost/numeric/odeint/config.hpp has a line #include <boost/config.hpp>, which is what visual must be complaining about; so I guess the package is not standalone. It must need other boost header files installed. I can't find anything in either the package homepage or the package tarball that mentions any dependencies, so I suppose you should try to install boost too. Download version 1.51.0 here, and this is the windows documentation.

You must download odeint from http://headmyshoulder.github.io/odeint-v2/downloads.html and Boost c++ libraries from http://www.boost.org/users/history/version_1_51_0.html. If you use codeblocks right click your project, select build oprions, select Search Directories and add two references one for odeint and one for boost.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top