Boost C++ Libraries: Ticket #6007: syntax error in VS2010 https://svn.boost.org/trac10/ticket/6007 <p> I have error follwing subscript but i dont know how to fix it. </p> <p> could you advise me? </p> <p> Develop spcifications : Windows 7 64 bits, Visual studio 2010 sp1, Boost 1.47 version </p> <p> 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/dynamic_bitset/dynamic_bitset.hpp(57): error C2059: syntax error : 'constant' 1&gt; C:\Program Files (x86)\boost\boost_1_47\boost/dynamic_bitset/dynamic_bitset.hpp(477) : see reference to class template instantiation 'boost::dynamic_bitset&lt;Block,Allocator&gt;' being compiled 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/dynamic_bitset/dynamic_bitset.hpp(57): error C2059: syntax error : ')' 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/dynamic_bitset/dynamic_bitset.hpp(57): error C2238: unexpected token(s) preceding ';' 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/pool/detail/ct_gcd_lcm.hpp(54): warning C4002: too many actual parameters for macro 'assert' 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/pool/detail/ct_gcd_lcm.hpp(54): error C2059: syntax error : 'constant' 1&gt; C:\Program Files (x86)\boost\boost_1_47\boost/pool/detail/ct_gcd_lcm.hpp(57) : see reference to class template instantiation 'boost::details::pool::ct_gcd&lt;A,B&gt;' being compiled 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/pool/detail/ct_gcd_lcm.hpp(54): error C2059: syntax error : ')' 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/pool/detail/ct_gcd_lcm.hpp(54): error C2238: unexpected token(s) preceding ';' 1&gt;C:\Program Files (x86)\boost\boost_1_47\boost/pool/detail/ct_gcd_lcm.hpp(54): error C2059: syntax error : 'constant' </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6007 Trac 1.4.3 webmacome@… Tue, 11 Oct 2011 08:01:33 GMT component changed; owner set https://svn.boost.org/trac10/ticket/6007#comment:1 https://svn.boost.org/trac10/ticket/6007#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">jsiek</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">dynamic_bitset</span> </li> </ul> Ticket Steven Watanabe Sun, 16 Oct 2011 22:54:20 GMT <link>https://svn.boost.org/trac10/ticket/6007#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6007#comment:2</guid> <description> <p> Do you have a minimal test case for this? </p> <p> If I have to guess, I'd say that it's a macro problem. Can you preprocess the source and find what boost/dynamic_bitset/dynamic_bitset.hpp line 57 expands to? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 17 Oct 2011 03:03:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6007#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6007#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6007#comment:2" title="Comment 2">steven_watanabe</a>: </p> <blockquote class="citation"> <p> Do you have a minimal test case for this? </p> <p> If I have to guess, I'd say that it's a macro problem. Can you preprocess the source and find what boost/dynamic_bitset/dynamic_bitset.hpp line 57 expands to? </p> </blockquote> <p> I don't have minimal test, because all the errors are in boost_1_47 I'm trying to change code enviroments from VS2008 to VS2010. It's work in Visual Stusio 2008 base.But It's not in VS2010 Should I change some options in VS 2010? Don't you have any similar problems from other users?? </p> <p> I include Boost <a class="missing wiki">BoostPython</a>.h, dynamic_bitset.hpp, tuple.hpp, shared_ptr.hpp, shared_array.hpp </p> <p> All the syntax errors are in dynamic_bitset.hpp(57), ct_gcd_lcm.hpp(54), pool.hpp(143) </p> <p> Help me~plz </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 17 Oct 2011 03:40:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6007#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6007#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6007#comment:3" title="Comment 3">anonymous</a>: </p> <blockquote class="citation"> <p> I don't have minimal test, because all the errors are in boost_1_47 I'm trying to change code enviroments from VS2008 to VS2010. It's work in Visual Stusio 2008 base.But It's not in VS2010 Should I change some options in VS 2010? Don't you have any similar problems from other users?? </p> </blockquote> <p> I haven't heard this one before. Basic code using dynamic_bitset compiles for me with VS2010. </p> <blockquote class="citation"> <p> I include Boost <a class="missing wiki">BoostPython</a>.h, dynamic_bitset.hpp, tuple.hpp, shared_ptr.hpp, shared_array.hpp </p> </blockquote> <p> What is BoostPython.h? I don't have such a header. </p> <blockquote class="citation"> <p> All the syntax errors are in dynamic_bitset.hpp(57), ct_gcd_lcm.hpp(54), pool.hpp(143) </p> <p> Help me~plz </p> </blockquote> <p> This is behaving as though static_assert is defined as a macro. Try adding </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#ifdef static_assert</span> <span class="cp">#error static_assert is defined</span> <span class="cp">#endif</span> </pre></div></div><p> in the source file after all #includes. If this fires, then that's the problem. static_assert is a keyword, so whatever is #defining it is wrong. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 17 Oct 2011 06:58:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6007#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6007#comment:5</guid> <description> <p> I meant boost python is boost/pyton.hpp </p> <p> anyway after preprocessing in vs2010,i've got follwing script. originally dynamic_bitset has this script "BOOST_STATIC_ASSERT((bool)detail::dynamic_bitset_impl::allowed_block_type&lt;Block&gt;::value);" but i think vs2010 can't read it. </p> <blockquote> <p> BOOST_STATIC_ASSERT((bool)detail::dynamic_bitset_impl::allowed_block_type&lt;Block&gt;::value); </p> </blockquote> <p> been changed -&gt; ((void)0); </p> <p> *after preprocessing script : </p> <blockquote> <p> #line 42 "C:<br />Program Files (x86)<br />boost<br />boost_1_47<br />boost/dynamic_bitset/dynamic_bitset.hpp" </p> </blockquote> <p> namespace boost { </p> <p> template &lt;typename Block, typename Allocator&gt; class dynamic_bitset { </p> <blockquote> <p> ((void)0); </p> </blockquote> <p> public: </p> <blockquote> <p> typedef Block block_type; typedef Allocator allocator_type; typedef std::size_t size_type; typedef block_type block_width_type; </p> </blockquote> <blockquote> <p> static const block_width_type bits_per_block = (std::numeric_limits&lt;Block&gt;::digits); static const size_type npos = static_cast&lt;size_type&gt;(-1); </p> </blockquote> <p> public: </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 17 Oct 2011 14:39:25 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6007#comment:6 https://svn.boost.org/trac10/ticket/6007#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6007#comment:5" title="Comment 5">anonymous</a>: </p> <blockquote class="citation"> <blockquote> <p> BOOST_STATIC_ASSERT((bool)detail::dynamic_bitset_impl::allowed_block_type&lt;Block&gt;::value); </p> </blockquote> <p> been changed -&gt; ((void)0); </p> </blockquote> <p> Yep. Something is definitely doing </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#define static_assert assert</span> </pre></div></div><p> Whatever is causing this isn't a Boost bug. </p> Ticket fearhope@… Wed, 29 Aug 2012 14:52:24 GMT <link>https://svn.boost.org/trac10/ticket/6007#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6007#comment:7</guid> <description> <p> I encountered same errors after adding VCGLib with boost lib. and I found that VCGLib had a "static_assert" macro in a header file "base.h" like as follows. </p> <blockquote> <p> #define static_assert assert </p> </blockquote> <p> therefore, I searched all "static_assert" lines referencing the macro in all VCGLib source files and changed it to "vcg_static_assert". Then, the compile errors all were gone. </p> <p> I hope this information will help one who has similar problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 27 Mar 2013 12:40:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6007#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6007#comment:8</guid> <description> <p> Thanks! I had the same problem with VCGLib </p> </description> <category>Ticket</category> </item> </channel> </rss>