Hi, you need to add in #include
#include <iostream>
#include <cstdlib>
#include
#include
int main(int argc, char *argv[])
{
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (int i = 0; i < m.size1 (); ++ i)
for (int j = 0; j < m.size2 (); ++ j)
m (i, j) = 3 * i + j;
std::cout << m << std::endl;
}
Jon Agiato
JonAgiato@nyc.rr.com
----- Original Message -----
From: Zdenek Hurak
To: boost-users@yahoogroups.com
Sent: Wednesday, March 19, 2003 10:13 AM
Subject: [Boost-Users] Help with my first compilation with uBLAS
Hello,
Could anybody help me with my first compilation of a simple code using
MATRIX class from uBLAS library?
Namely, I can't set all the "include" properly. Have a look at the code
snipet:
----------------------------------------------------------------------------------
#include
#include
#include
int main(int argc, char *argv[])
{
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (int i = 0; i < m.size1 (); ++ i)
for (int j = 0; j < m.size2 (); ++ j)
m (i, j) = 3 * i + j;
std::cout << m << std::endl;
}
------------------------------------------------------------------------------------
I get an error message:
main.cpp:21:42: boost/numeric/ublas/matrix.hpp: No such file or directory
I use gcc/g++ on i386-linux and I set a parameter of the compiler to:
--x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/
which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp".
Could you please explain to me what is still missing? I cannot find any
example on the BOOST web. I am not much experienced in all this "include"
stuff. Before delving deeper into the compiler options I would like to know
if everything else is correct.
Thanks
Zdenek Hurak
Yahoo! Groups Sponsor
ADVERTISEMENT
Info: http://www.boost.org
Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl
Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]