yinglcs2
May 24th, 2007, 10:10 PM
Hi,
I think I have installed boost library on ubunut successfully:
$ sudo apt-get install libboost*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting libboost-regex1.33.1 for regex 'libboost*'
Note, selecting libboost-thread-dev for regex 'libboost*'
Note, selecting libboost-graph-dev for regex 'libboost*'
Note, selecting libboost-date-time-dev for regex 'libboost*'
Note, selecting libboost-dbg for regex 'libboost*'
Note, selecting libboost-iostreams-dev for regex 'libboost*'
Note, selecting libboost-dev for regex 'libboost*'
Note, selecting libboost-doc for regex 'libboost*'
Note, selecting libboost-thread1.33.1 for regex 'libboost*'
Note, selecting libboost-filesystem-dev for regex 'libboost*'
Note, selecting libboost-date-time1.33.1 for regex 'libboost*'
Note, selecting libboost-test-dev for regex 'libboost*'
Note, selecting libboost-wave-dev for regex 'libboost*'
Note, selecting libboost-serialization-dev for regex 'libboost*'
Note, selecting libboost-signals-dev for regex 'libboost*'
Note, selecting libboost-signals1.33.1 for regex 'libboost*'
Note, selecting libboost-regex-dev for regex 'libboost*'
Note, selecting libboost-python-dev for regex 'libboost*'
Note, selecting libboost-filesystem1.33.1 for regex 'libboost*'
Note, selecting libboost-python1.33.1 for regex 'libboost*'
Note, selecting libboost-program-options-dev for regex 'libboost*'
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
But when I compile this simple program, i can't find 'thread.hpp', can you please tell me why?
#include <boost/thread/thread.hpp>
#include <iostream>
void hello()
{
std::cout <<
"Hello world, I'm a thread!"
<< std::endl;
}
int main(int argc, char* argv[])
{
boost::thread thrd(&hello);
thrd.join();
return 0;
}
../main.cpp:13:35: warning: boost/thread/thread.hpp: No such file or directory
../main.cpp:28:2: warning: no newline at end of file
I think I have installed boost library on ubunut successfully:
$ sudo apt-get install libboost*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting libboost-regex1.33.1 for regex 'libboost*'
Note, selecting libboost-thread-dev for regex 'libboost*'
Note, selecting libboost-graph-dev for regex 'libboost*'
Note, selecting libboost-date-time-dev for regex 'libboost*'
Note, selecting libboost-dbg for regex 'libboost*'
Note, selecting libboost-iostreams-dev for regex 'libboost*'
Note, selecting libboost-dev for regex 'libboost*'
Note, selecting libboost-doc for regex 'libboost*'
Note, selecting libboost-thread1.33.1 for regex 'libboost*'
Note, selecting libboost-filesystem-dev for regex 'libboost*'
Note, selecting libboost-date-time1.33.1 for regex 'libboost*'
Note, selecting libboost-test-dev for regex 'libboost*'
Note, selecting libboost-wave-dev for regex 'libboost*'
Note, selecting libboost-serialization-dev for regex 'libboost*'
Note, selecting libboost-signals-dev for regex 'libboost*'
Note, selecting libboost-signals1.33.1 for regex 'libboost*'
Note, selecting libboost-regex-dev for regex 'libboost*'
Note, selecting libboost-python-dev for regex 'libboost*'
Note, selecting libboost-filesystem1.33.1 for regex 'libboost*'
Note, selecting libboost-python1.33.1 for regex 'libboost*'
Note, selecting libboost-program-options-dev for regex 'libboost*'
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
But when I compile this simple program, i can't find 'thread.hpp', can you please tell me why?
#include <boost/thread/thread.hpp>
#include <iostream>
void hello()
{
std::cout <<
"Hello world, I'm a thread!"
<< std::endl;
}
int main(int argc, char* argv[])
{
boost::thread thrd(&hello);
thrd.join();
return 0;
}
../main.cpp:13:35: warning: boost/thread/thread.hpp: No such file or directory
../main.cpp:28:2: warning: no newline at end of file