Dear boost program(for c++,(or g++)):
after I download 1.46.1 and try to baseon it to compile a simple
program from book C++cookbook, at page 447, 12.1 Creating a Thread
----------
// example 12-1. Creating a thread
#include <iostream>
#include
#include
struct MyThreadFunc {
void operator()() {
// Do something long-running...
}
} threadFun;
int main() {
boost::thread myThread(threadFun); // Create a thread that starts
// running threadFun
boost::thread::yield(); // give up the main thread's timeslice
// so the child thread can get some work
// done.
// Go do some other work...
myThread.join(); // The current (i.e., main) thread will wait
// for myThread to finish before it returns
}
-----------------------------------------------------------
eric@eric-laptop:~/cppcookbook$ ls
example12-1.cpp
eric@eric-laptop:~/cppcookbook$ g++ -I/home/eric/boost1/boost_1_46_1/ example12-1.cpp -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_thread-mt
collect2: ld returned 1 exit status
eric@eric-laptop:~/cppcookbook$ g++ -I/home/eric/boost1/boost_1_46_1/ example12-1.cpp -lboost
/usr/bin/ld: cannot find -lboost
collect2: ld returned 1 exit status
eric@eric-laptop:~/cppcookbook$ cd ../boost1/boost_1_46_1/
eric@eric-laptop:~/boost1/boost_1_46_1$
--------------------------
I am in Ubuntu linux 10.04, g++ 4.4.3
looking to see any suggestion and thanks a lot in advance, Eric Lin, Us citizen, in Los Angeles
I am glad to meet anyone in Los Angeles on computer science meeting