Results 1 to 4 of 4
I'm new to Linux. Under Windows, I use Visual C++ to build my app with boost libraries. However under Ubuntu, I got some problems. I did some google search and ...
- 11-11-2008 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 3
How to link to all boost library by command line ?
I'm new to Linux. Under Windows, I use Visual C++ to build my app with boost libraries. However under Ubuntu, I got some problems. I did some google search and I find out that to link a specific library, for example :
On terminal I use this :Code:#include <boost/thread/thread.hpp> #include <iostream> #include <boost/array.hpp> #include <boost/regex.hpp> void hello() { std::cout << "Hello world, I'm a thread!" << std::endl; } int main(int argc, char* argv[]) { boost::array< int, 4 > ary; boost::thread thrd( &hello ); thrd.join(); return 0; }
It worked, but I want a more general way to handle this. How could I link all my libraries so that I don't have to remember all the -lboost_...g++ ex1.cpp -o ex1 -lboost_thread
Or could anyone show me a makefile use to compile C++ with boost libraries.
Any help or suggestion would be appreciated. Thanks everybody !
- 11-11-2008 #2then put that in the same directory as your source file, and type make.#makefile
all:
g++ ex1.cpp -o ex1 -lboost_thread
clean:
rm ex1New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4
- 11-11-2008 #3Just Joined!
- Join Date
- Nov 2008
- Posts
- 3
- Thanks meton_magis. I'm really frustrated with boost-library. I used openGL, gtk+ and gktmm...without any difficulty of compilation and installation. But with boost, I couldn't find a way to get through it. I did a lot of google search but I never find a tutorial show how to install boost and build boost( even boost.org ), the way they describe is hard to understand and follow. For example, some of the examples I got compiled, some didn't.
- Could you show me how to install boost 1.37.0 from scratch ? I really want to learn boost but I always get trouble installing and compiling it.
- 11-12-2008 #4
I have no idea how you would do that. I would suggest using your distrobution's package manager to find and install it.
New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4


Reply With Quote