1

When I compile a simple CUDA .cu file using the nvcc compiler in Visual Studio 2013, it could be compiled and run correctly, but when I just include the "boost/make_shared.hpp" header file of BOOST1.61, it occured 4 errors:

the first one is " error MSB3721 ... exited with code 2 " the other 3 errors occured in the hearder file "...\boost_1_61_0\boost\smart_ptr\detail\array_allocator", in the same place of codes below:

#if !defined(BOOST_NO_CXX11_ALLOCATOR)
            typedef std::allocator_traits<A> AT;
            typedef typename AT::template rebind_alloc<char> CA;
            typedef typename AT::template rebind_traits<char> CT;
#else
            typedef typename A::template rebind<char>::other CA;

with error C4430 and error C2146

x64 platform. CUDA 7.5, win7 64bit.

Its a really strange problem because all the other configurations are correct, and it's only a simplest vector addition project, but when compiling the .cu CUDA file using nvcc, it just can't be compiled and always comes with these four errors. It would be successfully compiled when using the normal c++ compiler. So if anyone can help me sove this problem, thanks a lot~~~

xwdu
  • 11
  • 1
  • 1
    you can either completely separate CUDA and normal C++ code and only include boost in the latter; you can also use C++11's `std::shared_ptr>` instead of the boost one to avoid the boost include – m.s. Oct 19 '16 at 06:29
  • the cuda front end is known to have proböems with extremely complex template libraries, like boost. – talonmies Oct 20 '16 at 09:40

0 Answers0