boost.cgi first compile error

I have just installed boost and boost.cgi (fastcgi from http://cgi.sourceforge.net/). Boost compile without errors using a "header-only library" and "Boost Library Binary" but when I compile this dummy program to test boost.cgi:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <boost/cgi/cgi.hpp>

int main()
{
  // request req;
  // response resp;

  // resp<< "Hello there, Universe. "
  //     << "-- " << req.get["name"];

  // return commit(req, resp); // write the response
  return 0;
}

I get a very long list of errors:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
c++ test.cpp -o test

In file included from /usr/local/include/boost/mpl/int.hpp:17,
                 from /usr/local/include/boost/cgi/fcgi/specification.hpp:336,
                 from /usr/local/include/boost/cgi/common/protocol_traits.hpp:20,
                 from /usr/local/include/boost/cgi/common/basic_protocol_service.hpp:20,
                 from /usr/local/include/boost/cgi/cgi/service.hpp:26,
                 from /usr/local/include/boost/cgi/cgi/request.hpp:15,
                 from /usr/local/include/boost/cgi/cgi.hpp:15,
                 from test.cpp:10:
/usr/local/include/boost/mpl/int_fwd.hpp:25: error: ‘::mpl_’ has not been declared
In file included from /usr/local/include/boost/mpl/aux_/integral_wrapper.hpp:16,
                 from /usr/local/include/boost/mpl/int.hpp:20,
                 from /usr/local/include/boost/cgi/fcgi/specification.hpp:336,
                 from /usr/local/include/boost/cgi/common/protocol_traits.hpp:20,
                 from /usr/local/include/boost/cgi/common/basic_protocol_service.hpp:20,
                 from /usr/local/include/boost/cgi/cgi/service.hpp:26,
                 from /usr/local/include/boost/cgi/cgi/request.hpp:15,
                 from /usr/local/include/boost/cgi/cgi.hpp:15,
                 from test.cpp:10:
/usr/local/include/boost/mpl/integral_c_tag.hpp:24: error: ‘::mpl_’ has not been declared
. . . .
. . . .

I tried installing boost from ubuntu repository (1_40_0) and from boost site (1_46_0) but I got the same errors.

I think it's a problem of namespaces but I don't know what to do.

Thank you
First off, does your compile support boost::mpl? The metaprogramming library is very compiler intense and not all compiler versions support it.
When I try to install libboost-mpi-dev Iget this error:

libboost-mpi-dev:
Dipende: libboost-mpi1.40-dev but it is not installable

Perhaps I can try again installing the last version from Boost site (1_46_0). Now I using the Ubuntu version (1_40_0) with apt-get.

ps: is it the same, mpi and mpl?
Last edited on
I've just installed the last version from boost site. When it compile I have a lot of warning and I don't know whether it installs all libs . Now I have installed it as root (previously as user) in /opt/boost_1_46_0 and the libraries are in /opt/boost_1_46_0/stage/lib:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# ls stage/lib/ -la
totale 25660
drwxr-xr-x 2 root root    4096 2011-02-25 12:02 .
drwxr-xr-x 3 root root    4096 2011-02-25 11:48 ..
-rw-r--r-- 1 root root  118790 2011-02-25 11:53 libboost_date_time.a
lrwxrwxrwx 1 root root      28 2011-02-25 11:52 libboost_date_time.so -> libboost_date_time.so.1.46.0
-rwxr-xr-x 1 root root   92296 2011-02-25 11:52 libboost_date_time.so.1.46.0
-rw-r--r-- 1 root root  255140 2011-02-25 11:53 libboost_filesystem.a
lrwxrwxrwx 1 root root      29 2011-02-25 11:52 libboost_filesystem.so -> libboost_filesystem.so.1.46.0
-rwxr-xr-x 1 root root  147239 2011-02-25 11:52 libboost_filesystem.so.1.46.0
-rw-r--r-- 1 root root  540660 2011-02-25 11:54 libboost_graph.a
lrwxrwxrwx 1 root root      24 2011-02-25 11:49 libboost_graph.so -> libboost_graph.so.1.46.0
-rwxr-xr-x 1 root root  384838 2011-02-25 11:49 libboost_graph.so.1.46.0
-rw-r--r-- 1 root root  200922 2011-02-25 11:54 libboost_iostreams.a
lrwxrwxrwx 1 root root      28 2011-02-25 11:49 libboost_iostreams.so -> libboost_iostreams.so.1.46.0
-rwxr-xr-x 1 root root  133728 2011-02-25 11:49 libboost_iostreams.so.1.46.0
-rw-r--r-- 1 root root  287066 2011-02-25 11:55 libboost_math_c99.a
-rw-r--r-- 1 root root  283390 2011-02-25 11:55 libboost_math_c99f.a
lrwxrwxrwx 1 root root      28 2011-02-25 11:51 libboost_math_c99f.so -> libboost_math_c99f.so.1.46.0
-rwxr-xr-x 1 root root  133272 2011-02-25 11:51 libboost_math_c99f.so.1.46.0
-rw-r--r-- 1 root root  288384 2011-02-25 11:55 libboost_math_c99l.a
lrwxrwxrwx 1 root root      28 2011-02-25 11:51 libboost_math_c99l.so -> libboost_math_c99l.so.1.46.0
-rwxr-xr-x 1 root root  132428 2011-02-25 11:51 libboost_math_c99l.so.1.46.0
lrwxrwxrwx 1 root root      27 2011-02-25 11:51 libboost_math_c99.so -> libboost_math_c99.so.1.46.0
-rwxr-xr-x 1 root root  138046 2011-02-25 11:51 libboost_math_c99.so.1.46.0
-rw-r--r-- 1 root root 1756110 2011-02-25 11:54 libboost_math_tr1.a
-rw-r--r-- 1 root root 1765676 2011-02-25 11:55 libboost_math_tr1f.a
lrwxrwxrwx 1 root root      28 2011-02-25 11:50 libboost_math_tr1f.so -> libboost_math_tr1f.so.1.46.0
-rwxr-xr-x 1 root root  312947 2011-02-25 11:50 libboost_math_tr1f.so.1.46.0
-rw-r--r-- 1 root root 1757520 2011-02-25 11:55 libboost_math_tr1l.a
lrwxrwxrwx 1 root root      28 2011-02-25 11:51 libboost_math_tr1l.so -> libboost_math_tr1l.so.1.46.0
-rwxr-xr-x 1 root root  300595 2011-02-25 11:51 libboost_math_tr1l.so.1.46.0
lrwxrwxrwx 1 root root      27 2011-02-25 11:50 libboost_math_tr1.so -> libboost_math_tr1.so.1.46.0
-rwxr-xr-x 1 root root  300714 2011-02-25 11:50 libboost_math_tr1.so.1.46.0
-rw-r--r-- 1 root root   90942 2011-02-25 12:01 libboost_prg_exec_monitor.a
lrwxrwxrwx 1 root root      35 2011-02-25 12:01 libboost_prg_exec_monitor.so -> libboost_prg_exec_monitor.so.1.46.0
-rwxr-xr-x 1 root root   77833 2011-02-25 12:01 libboost_prg_exec_monitor.so.1.46.0
-rw-r--r-- 1 root root  739022 2011-02-25 12:00 libboost_program_options.a
lrwxrwxrwx 1 root root      34 2011-02-25 12:00 libboost_program_options.so -> libboost_program_options.so.1.46.0
-rwxr-xr-x 1 root root  435792 2011-02-25 12:00 libboost_program_options.so.1.46.0
-rw-r--r-- 1 root root    8868 2011-02-25 11:55 libboost_random.a
lrwxrwxrwx 1 root root      25 2011-02-25 11:51 libboost_random.so -> libboost_random.so.1.46.0
-rwxr-xr-x 1 root root   13058 2011-02-25 11:51 libboost_random.so.1.46.0
-rw-r--r-- 1 root root 2070238 2011-02-25 11:53 libboost_regex.a
lrwxrwxrwx 1 root root      24 2011-02-25 11:52 libboost_regex.so -> libboost_regex.so.1.46.0
-rwxr-xr-x 1 root root 1242477 2011-02-25 11:52 libboost_regex.so.1.46.0
-rw-r--r-- 1 root root 1023338 2011-02-25 11:56 libboost_serialization.a
lrwxrwxrwx 1 root root      32 2011-02-25 11:51 libboost_serialization.so -> libboost_serialization.so.1.46.0
-rwxr-xr-x 1 root root  645812 2011-02-25 11:51 libboost_serialization.so.1.46.0
-rw-r--r-- 1 root root  139202 2011-02-25 11:56 libboost_signals.a
lrwxrwxrwx 1 root root      26 2011-02-25 11:52 libboost_signals.so -> libboost_signals.so.1.46.0
-rwxr-xr-x 1 root root   99503 2011-02-25 11:52 libboost_signals.so.1.46.0
-rw-r--r-- 1 root root   15498 2011-02-25 11:53 libboost_system.a
lrwxrwxrwx 1 root root      25 2011-02-25 11:52 libboost_system.so -> libboost_system.so.1.46.0
-rwxr-xr-x 1 root root   20109 2011-02-25 11:52 libboost_system.so.1.46.0
-rw-r--r-- 1 root root 1476346 2011-02-25 12:01 libboost_test_exec_monitor.a
-rw-r--r-- 1 root root  153828 2011-02-25 11:56 libboost_thread.a
lrwxrwxrwx 1 root root      25 2011-02-25 11:52 libboost_thread.so -> libboost_thread.so.1.46.0
-rwxr-xr-x 1 root root  123301 2011-02-25 11:52 libboost_thread.so.1.46.0
-rw-r--r-- 1 root root 1633854 2011-02-25 12:01 libboost_unit_test_framework.a
lrwxrwxrwx 1 root root      38 2011-02-25 12:02 libboost_unit_test_framework.so -> libboost_unit_test_framework.so.1.46.0
-rwxr-xr-x 1 root root  941323 2011-02-25 12:02 libboost_unit_test_framework.so.1.46.0
-rw-r--r-- 1 root root 2946806 2011-02-25 11:57 libboost_wave.a
lrwxrwxrwx 1 root root      23 2011-02-25 11:52 libboost_wave.so -> libboost_wave.so.1.46.0
-rwxr-xr-x 1 root root 1718102 2011-02-25 11:52 libboost_wave.so.1.46.0
-rw-r--r-- 1 root root  717198 2011-02-25 11:56 libboost_wserialization.a
lrwxrwxrwx 1 root root      33 2011-02-25 11:52 libboost_wserialization.so -> libboost_wserialization.so.1.46.0
-rwxr-xr-x 1 root root  475914 2011-02-25 11:52 libboost_wserialization.so.1.46.0
 


in /opt/boost_1_46_0/boost I moved in the cgi and cgi.hpp

and set BOOST_ROOT:
1
2
echo $BOOST_ROOT 
/opt/boost_1_46_0


the boost examples (http://www.boost.org/doc/libs/1_46_0/more/getting_started/unix-variants.html) compile as root and as user but not the test.cpp program:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 c++ -I /opt/boost_1_46_0 test.cpp -o test

In file included from /opt/boost_1_46_0/boost/mpl/int.hpp:17,
                 from /opt/boost_1_46_0/boost/cgi/fcgi/specification.hpp:336,
                 from /opt/boost_1_46_0/boost/cgi/common/protocol_traits.hpp:20,
                 from /opt/boost_1_46_0/boost/cgi/common/basic_protocol_service.hpp:20,
                 from /opt/boost_1_46_0/boost/cgi/cgi/service.hpp:26,
                 from /opt/boost_1_46_0/boost/cgi/cgi/request.hpp:15,
                 from /opt/boost_1_46_0/boost/cgi/cgi.hpp:15,
                 from test.cpp:10:
/opt/boost_1_46_0/boost/mpl/int_fwd.hpp:25: error: ‘::mpl_’ has not been declared
In file included from /opt/boost_1_46_0/boost/mpl/aux_/integral_wrapper.hpp:16,
                 from /opt/boost_1_46_0/boost/mpl/int.hpp:20,
                 from /opt/boost_1_46_0/boost/cgi/fcgi/specification.hpp:336,
                 from /opt/boost_1_46_0/boost/cgi/common/protocol_traits.hpp:20,
                 from /opt/boost_1_46_0/boost/cgi/common/basic_protocol_service.hpp:20,
                 from /opt/boost_1_46_0/boost/cgi/cgi/service.hpp:26,
                 from /opt/boost_1_46_0/boost/cgi/cgi/request.hpp:15,
                 from /opt/boost_1_46_0/boost/cgi/cgi.hpp:15,
                 from test.cpp:10:
/opt/boost_1_46_0/boost/mpl/integral_c_tag.hpp:24: error: ‘::mpl_’ has not been declared
. . .
. . .

I have just tested it in a new and clean debian distribution with virtualbox.

I did:
- install build-essential libbz2-dev libghc6-zlib-dev with apt-get
- decompress boost_1_46_0.tar.gz in /opt as root

in /opt/boost_1_46_0:
- ./bootstrap.sh
- ./bjam --with-???? (for every library to look for errors)

next:
- decompress in another directory cgi-0.7.1.tar.gz and copied ./cgi-0.7.1/boost/cgi/ and ./cgi-0.7.1/boost/cgi.hpp
into /opt/boost_1_46_0/boost

and:
- BOOST_ROOT=/opt/boost_1_46_0/
- export BOOST_ROOT

- tested boost as in: http://www.boost.org/doc/libs/1_46_0/more/getting_started/unix-variants.html

- tested cgi with this file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
    #include <boost/lambda/lambda.hpp>
    #include <iostream>
    #include <iterator>
    #include <algorithm>
*/
#include <boost/cgi/cgi.hpp>

int main()
{
    /*
        using namespace boost::lambda;
        typedef std::istream_iterator<int> in;

        std::for_each( in(std::cin), in(), std::cout << (_1 * 3) << " " );
   */
    return 0;
}


compiling with: c++ -I /opt/boost_1_46_0 example.cpp -o example_text


I found this in ReadMe file:


Currently tested on

Ubuntu 8.04 desktop 32bit
Ubuntu 9.10 desktop 32bit
Ubuntu 8.04 server 64bit
MSVC 2008 Windows XP
MSVC 2008 Windows 7

If you have the other version of Ubuntu / or the 64 bit's earlier/later than 8.04, you could have this problem.
Last edited on
1
2
3
4
5
6
7
8
9
10
11
I found this in ReadMe file:

Currently tested on

Ubuntu 8.04 desktop 32bit
Ubuntu 9.10 desktop 32bit
Ubuntu 8.04 server 64bit
MSVC 2008 Windows XP
MSVC 2008 Windows 7

If you have the other version of Ubuntu / or the 64 bit's earlier/later than 8.04, you could have this problem. 

Yes, perhaps the problem is this, I tested it with ubuntu 10.04 and debian 6 and they both are too recent.

I give up, I'll try something else.

Thank you
Topic archived. No new replies allowed.