boost library compilation with nvcc


I am getting the following errors while compiling my code with nvcc.

boost_1_43_0/boost/mpl/size_t_fwd.hpp:23: error: expected unqualified-id before ‘[’ token
boost_1_43_0/boost/mpl/size_t_fwd.hpp:26: error: ‘mpl_::size_t’ has not been declared
boost/mpl/aux_/integral_wrapper.hpp:42: error: expected unqualified-id before ‘[’ token

Does anybody gets the same error while compiling C++ host code (containing boost library calls) and Cuda code.

Compilation is done on 64bit RedHat 5.5 , gcc version 4.1.2 20080704.

Cuda SDK 3.1 is used.

Which Boost headers are you #including in your code compiled by nvcc?


I am using the following headers:




I have the same problem. I can’t resolve it. My system specification is:

Ubuntu 9.10

Gcc and g++ version:

gcc/g++ (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)

I’m using Cuda 3.1 with newest Boost from trunk rev. 64563.

I found on Boost trac patch to mpl.


When I applied it new errors appeared.