views:

127

answers:

2

Working on moving some C++ code from Linux over to Windows. The code uses boost 1.4.2, however it keeps failing out on building the boost modules. Basically, every boost hpp file that happens to contain "namespace boost" errors with:

error C2143: syntax error : missing ';' before 'namespace' 

Any idea what could be causing this?

+4  A: 

Loss of ; before including Boost header could be cause of that. The following code produce such error:

struct X {}  // << ; lost here

#include <boost/shared_ptr.hpp>

This small code gives me the following error:

boost/config/suffix.hpp(460) : error C2143: syntax error : missing ';' before 'namespace'
Kirill V. Lyadvinsky
The error is showing up about 20 levels down in the includes tree... any tips on how to find the missing ;?Also... this code compiles on Linux, I haven't changed it.
Adam Haile
Check my sample. It produces the error somewhere in `suffix.hpp`. To locate the error just print `;` before first include of Boost headers. Move `;` up until you find place where it necessary.
Kirill V. Lyadvinsky
+1  A: 

Have you tried including these boost headers on the first line? If they compile fine that way, it's likely a missing ; in one of the headers included before them.

sbi