How to compile minimal_test.cpp with gcc?
Hi, I downloaded boost-1.31.0 and the bjam package. I first compiled bjam and copied the executeables to /usr/local/bin. Then I went on to boost-1.31.0 (patched with the regex files). I first changed the env variables for python and compiled and installed the package with: bjam "-sTOOLS=gcc" install After building was finished, the files where copied. The include files got installed under /usr/local/include/boost-1_31/boost. I made a symlink /usr/local/include/boost pointing to /usr/local/include/boost-1_31/boost. Now I tried to do a small test, taken from: http://www.boost.org/libs/test/test/minimal_test.cpp I tried to compile the file with: gcc -o test minimal_test.cpp But I get a lot of error messages saying: In file included from test.cpp:16: /usr/local/include/boost/test/minimal.hpp:44:47: libs/test/src/execution_monitor.cpp: No such file or directory In file included from test.cpp:16: /usr/local/include/boost/test/minimal.hpp:62: error: `execution_monitor' is not a class or namespace /usr/local/include/boost/test/minimal.hpp:62: error: invalid base-class specification /usr/local/include/boost/test/minimal.hpp:63: error: parse error before `::' token /usr/local/include/boost/test/minimal.hpp:75: error: type specifier omitted for parameter `c_string_literal' /usr/local/include/boost/test/minimal.hpp:75: error: parse error before `,' token /usr/local/include/boost/test/minimal.hpp:91: error: type specifier omitted for parameter `c_string_literal' /usr/local/include/boost/test/minimal.hpp:91: error: parse error before `,' token /usr/local/include/boost/test/minimal.hpp:98: error: parse error before `,' token /usr/local/include/boost/test/minimal.hpp:98: error: parse error before `,' token /usr/local/include/boost/test/minimal.hpp:98: error: missing ';' before right brace /usr/local/include/boost/test/minimal.hpp:98: error: semicolon missing after declaration of `boost::minimal_test::monitor' ... ... ... /usr/local/include/boost/test/minimal.hpp:130: error: parse error before `if' /usr/local/include/boost/test/minimal.hpp:138: error: syntax error before `<<' token test.cpp: In function `int test_main(int, char**)': test.cpp:54: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:55: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:57: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:58: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:60: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:61: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:63: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:64: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:66: error: `the_monitor' undeclared in namespace `boost::minimal_test' test.cpp:68: error: `the_monitor' undeclared in namespace `boost::minimal_test' Well, mostly interesting is the first line: /usr/local/include/boost/test/minimal.hpp:44:47: libs/test/src/execution_monitor.cpp: No such file or directory Why is a part of the source included here? Is there a special place where the source should be installed, so that it can be found? I also tried replacing the include statement pointing to the execution_monitor.hpp header file in the include directory, but this produced far more error messages. So how do I build this small test program under gcc 3.3 (Linux)??? Is there somewhere a good step by step guide (tutorial) how to use boost and how to set up the build environment for small projects? Sebastian -- ONE FAMILY! Leipzig 2012 - Olympic Summer Games http://www.leipzig2012.com/
Hi,
I downloaded boost-1.31.0 and the bjam package. I first compiled bjam and copied the executeables to /usr/local/bin. Then I went on to boost-1.31.0 (patched with the regex files). I first changed the env variables for python and compiled and installed the package with:
bjam "-sTOOLS=gcc" install
After building was finished, the files where copied. The include files got installed under /usr/local/include/boost-1_31/boost. I made a symlink /usr/local/include/boost pointing to /usr/local/include/boost-1_31/boost.
Now I tried to do a small test, taken from:
http://www.boost.org/libs/test/test/minimal_test.cpp
I tried to compile the file with:
gcc -o test minimal_test.cpp
But I get a lot of error messages saying:
In file included from test.cpp:16: /usr/local/include/boost/test/minimal.hpp:44:47:
"Sebastian Stein"
Gennadiy Rozental
But I get a lot of error messages saying:
In file included from test.cpp:16: /usr/local/include/boost/test/minimal.hpp:44:47: libs/test/src/execution_monitor.cpp: No such file or directory
There should be ..boost/libs directories installed with all source (cpp) and docs files files. I remember it was reported already that some procedure does not install it.
Well, now it works. I copied the doc/ and the libs/ directory from the source tree to /usr/local/boost/libs and /usr/local/boost/doc. I also created a symlink /usr/local/libs pointing to /usr/local/boost/libs. I think this is not a very good solution at all. It is very ugly to have a include/libs directory. Isn't there a better solution? Maybe could someone also using gcc and Linux post the layout of his boost lib/ and include/ tree, so that I can figure out what is going wrong? Or is this the normal setup? Thanks in advance, Sebastian -- ONE FAMILY! Leipzig 2012 - Olympic Summer Games http://www.leipzig2012.com/
participants (2)
-
Gennadiy Rozental
-
Sebastian Stein