How to Test C++ Boost Installation
Once C++ Boost is installed on a machine, the fastest way to test the installation is to use some of the libraries from it in test C++ programs and try to build them. The following two programs can be used for this purpose:
first.cpp
[cpp]#include
#include
int main()
{
boost::any a(5);
a = 7.67;
std::cout<
Build this program using:
The second example needs to be linked to a library file. If the above two programs build and run with out any problems, then boost is installed and working properly on your system.
second.cpp
[cpp]#include
#include
namespace bfs=boost::filesystem;
int main()
{
bfs::path p(“second.cpp”);
if(bfs::exists(p))
std::cout<
[...] You can now test the boost installation by compiling the two programs I had mentioned in my earlier post, using the following commands: [...]
Thanks – the article was very helpful!
(I think comment #1 may have gotten “eaten” – perhaps it referred to the examples folders and Jamfile included with the distribution?)
Please keep up the good work!
JOanzi,
Thanks.
The comment #1 is actually a pingback/trackback and is displayed only partially. The full text can be read by following the URL at the bottom(“Pinkback by …”).
Thanks for these excellent tutorials. May I suggest a tutorial? Walking someone _carefully_ through the Boost installation process would be marvelous. I am trying to install Boost on Mac OSX Leopard, and although I am doing the builds and getting results, I realize I am new enough to C++ that I am not confident in doing things that most tutorials assume I can do, such as linking a library, or making sure that paths are set correctly. I understand the concepts, but the actual syntax, what a program looks like, and what failure looks like are very very helpful. For example, your second example above shows linking in C++.
You might smile, but to someone who doesn’t know what to ask, Googling “linking C++” only causes the overwhelming feeling of despair. Your examples have helped me tremendously, and I encourage you to write some more. The best one to add to this tutorial would be the “ELSE” part of your statement above: “IF the above two programs build and run with out any problems, then boost is installed and working properly on your system…”
Thanks again for your excellent work!
John