centos(x86 64 비트 시스템)사용 boost 과정
8556 단어 MAC&iPhone 개발
yum groupinstall
"Development Tools"
2.boost 설치
yum install boost boost-devel boost-doc
: /usr/lib64
3.
4. makefile
- #include <boost/thread.hpp>
- #include <iostream>
- void task1() {
- // do stuff
- std::cout << "This is task1!" << std::endl;
- }
- void task2() {
- // do stuff
- std::cout << "This is task2!" << std::endl;
- }
- int main (int argc, char ** argv) {
- using namespace boost;
- thread thread_1 = thread(task1);
- thread thread_2 = thread(task2);
- // do other stuff
- thread_2.join();
- thread_1.join();
- return 0;
- }
g++ -I./inlcude -L./usr/lib64 asio_thread.cpp -lboost_thread-mt -o example
: /usr/lib64
5.
This is task2! This is task1!