Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I downloaded odeint-v2 in a folder called C++.
I created a new cpp file called HARMONIC.cpp.
XML
#include <iostream>
#include <vector>

#include <boost/numeric/odeint.hpp>

using namespace boost::numeric::odeint;

std::vector<double> state_type;

double gam = 0.15;

void harmonic_oscillator( const state_type &x , state_type &dxdt , const double )
{
    dxdt[0] = x[1];
    dxdt[1] = -x[0] - gam*x[1];
}

int main(int, char**)
{
    using namespace std;
    using namespace boost::numeric::odeint;



    state_type x(2);
    x[0] = 1.0;
    x[1] = 0.0;


    size_t steps = integrate( harmonic_oscillator ,
            x , 0.0 , 10.0 , 0.1 );
}


While compiling in ubuntu
g++ HARMONIC.cpp -o har.output

The error is as following

VB
HARMONIC.cpp:4:36: fatal error: boost/numeric/odeint.hpp: No such file or directory
compilation terminated.


But i downloaded in the same folder all the odeint-v2.

Please help me
Posted
Comments
Sergey Alexandrovich Kryukov 25-Aug-14 13:02pm    
This find is not there. What is unclear in this message? Sort out your relative path: relative to what location?
—SA
Richard MacCutchan 26-Aug-14 3:38am    
Don't use paths in your #include directives; use the compiler options to specifiy search paths. It's also possible that your path to the boost libraries is not a subdirectory of your build tree.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900