By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,313 Members | 2,725 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,313 IT Pros & Developers. It's quick & easy.

Trying Boost under Ubuntu but fail

P: n/a
Hi All,

I'm trying Boost in my Ubuntu machine for the first time.
It's a simple code that use tuple.

But when I g++ it, it says:
tuple: no such file or directory

I installed boost 1.33.1, I proved it with apt-get install

What should I do? I need boost 1.34?

Nov 9 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Lambda wrote:
Hi All,

I'm trying Boost in my Ubuntu machine for the first time.
It's a simple code that use tuple.

But when I g++ it, it says:
tuple: no such file or directory

I installed boost 1.33.1, I proved it with apt-get install

What should I do? I need boost 1.34?
Even if your message were intopic, if you don't provide the source code
and the compiler command line there is no possibility to help you out.
Probably you didn't include the boost directory in your include path.

Regards,

Zeppe
Nov 9 '07 #2

P: n/a
On Nov 9, 5:45 pm, Zeppe <ze...@remove.all.this.long.comment.yahoo.it>
wrote:
Lambda wrote:
Hi All,
I'm trying Boost in my Ubuntu machine for the first time.
It's a simple code that use tuple.
But when I g++ it, it says:
tuple: no such file or directory
I installed boost 1.33.1, I proved it with apt-get install
What should I do? I need boost 1.34?

Even if your message were intopic, if you don't provide the source code
and the compiler command line there is no possibility to help you out.
Probably you didn't include the boost directory in your include path.

Regards,

Zeppe
#include <tuple>
#include <iostream>
#include <utility>
using std::cout;
using std::pair; using std::make_pair;
using std::tr1::tuple; using std::tr1::make_tuple;
using std::tr1::get;

int main()
{
pair<int, doublepr = make_pair(1, 2.1);
cout << pr.first << ", " << pr.second << '\n';
tuple<int, double, longtp = make_tuple(1, 2.1, 3);
cout << get<0>(tp) << ", " << get<1>(tp)
<< ", " << get<2>(tp) << '\n';

return 0;
}

Nov 9 '07 #3

P: n/a
On Nov 9, 5:55 pm, Lambda <stephenh...@gmail.comwrote:
On Nov 9, 5:45 pm, Zeppe <ze...@remove.all.this.long.comment.yahoo.it>
wrote:
Lambda wrote:
Hi All,
I'm trying Boost in my Ubuntu machine for the first time.
It's a simple code that use tuple.
But when I g++ it, it says:
tuple: no such file or directory
I installed boost 1.33.1, I proved it with apt-get install
What should I do? I need boost 1.34?
Even if your message were intopic, if you don't provide the source code
and the compiler command line there is no possibility to help you out.
Probably you didn't include the boost directory in your include path.
Regards,
Zeppe

#include <tuple>
#include <iostream>
#include <utility>
using std::cout;
using std::pair; using std::make_pair;
using std::tr1::tuple; using std::tr1::make_tuple;
using std::tr1::get;

int main()
{
pair<int, doublepr = make_pair(1, 2.1);
cout << pr.first << ", " << pr.second << '\n';
tuple<int, double, longtp = make_tuple(1, 2.1, 3);
cout << get<0>(tp) << ", " << get<1>(tp)
<< ", " << get<2>(tp) << '\n';

return 0;

}
I compile with:

g++ tuple.cc

Need I help g++ to find the lib?

Nov 9 '07 #4

P: n/a
Lambda wrote:
>#include <tuple>
there is no such a file. If you give a look to your /usr/include, that
is the dir in your include path by default, there is a folder for boost.
you need

#include <boost/tuple/tuple.hpp>
>#include <iostream>
#include <utility>
using std::cout;
using std::pair; using std::make_pair;
>using std::tr1::tuple; using std::tr1::make_tuple;
using std::tr1::get;
this is not a prt of the standard. tuple, make_tuple and get are boost
components, and are in the boost namespace:

using boost::tuple;
... etc.
>>
int main()
{
pair<int, doublepr = make_pair(1, 2.1);
cout << pr.first << ", " << pr.second << '\n';
tuple<int, double, longtp = make_tuple(1, 2.1, 3);
cout << get<0>(tp) << ", " << get<1>(tp)
<< ", " << get<2>(tp) << '\n';

return 0;

}

I compile with:

g++ tuple.cc

Need I help g++ to find the lib?
there is no lib file because the entire library is inilne ni the header.

Note that all I wrote is in the manual. Check it out at
http://www.boost.org/libs/tuple/doc/...ers_guide.html

Regards,

Zeppe
Nov 9 '07 #5

P: n/a
On Nov 9, 5:31 am, Lambda <stephenh...@gmail.comwrote:
Hi All,

I'm trying Boost in my Ubuntu machine for the first time.
It's a simple code that use tuple.

But when I g++ it, it says:
tuple: no such file or directory

I installed boost 1.33.1, I proved it with apt-get install

What should I do? I need boost 1.34?
Complementing the other comments: Boost TR1 implementation (http://
www.boost.org/doc/html/boost_tr1.html) belong to version 1.34.0 or
above. Take a look to http://www.boost.org/more/version_history.html.

Regards

--
Cholo Lennon
Bs.As.
ARG


Nov 9 '07 #6

P: n/a
On Nov 9, 8:10 pm, Zeppe <ze...@remove.all.this.long.comment.yahoo.it>
wrote:
Lambda wrote:
#include <tuple>

there is no such a file. If you give a look to your /usr/include, that
is the dir in your include path by default, there is a folder for boost.
you need

#include <boost/tuple/tuple.hpp>
#include <iostream>
#include <utility>
using std::cout;
using std::pair; using std::make_pair;
using std::tr1::tuple; using std::tr1::make_tuple;
using std::tr1::get;

this is not a prt of the standard. tuple, make_tuple and get are boost
components, and are in the boost namespace:

using boost::tuple;
.. etc.


int main()
{
pair<int, doublepr = make_pair(1, 2.1);
cout << pr.first << ", " << pr.second << '\n';
tuple<int, double, longtp = make_tuple(1, 2.1, 3);
cout << get<0>(tp) << ", " << get<1>(tp)
<< ", " << get<2>(tp) << '\n';
return 0;
}
I compile with:
g++ tuple.cc
Need I help g++ to find the lib?

there is no lib file because the entire library is inilne ni the header.

Note that all I wrote is in the manual. Check it out athttp://www.boost.org/libs/tuple/doc/tuple_users_guide.html

Regards,

Zeppe
I changed the header and the namespace, it works now.

Nov 10 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.