Hi,
I'm getting syntax errors when I try to compile a c++ project that uses pantheios (and stlsoft through this) with visual studio 2010:
4>F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(156): error C2059: syntax error : ')'
4> F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(166) : see reference to class template instantiation 'stlsoft::auto_buffer_internal_size_calculator<T>' being compiled
4>F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(160): error C2760: syntax error : expected ',' not ';'
4>F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(160): error C2143: syntax error : missing '}' before 'public'
4>F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(160): error C2059: syntax error : 'public'
4>F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(161): error C2059: syntax error : 'enum [tag]'
4>F:\libs\stlsoft-1.9.108\include\stlsoft/memory/auto_buffer.hpp(161): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
Can you post a minimal-sized project / .cpp file that exercises the issue?
Thanks
Matt
I'm desperately trying to get the same effect in a minimal project but i fail. Everything seems to work in a small project. Do you have any suggestions on how I could find out what is causing this behaviour?
Note: the project I try to compile did build fine when I developed it for linux. I'm in the middle of porting the software to Windows.
Hi again
Thanks for your efforts so far.
I've had a look at this myself, and I'm pretty sure that it's a problem with one of the Pantheios examples/test-programs. I'll try to confirm, and release a fix, in the next 48 hours.
For now, just do "[n]make build.libs", and that way it won't try to compile the erroneous test/example program
HTH
Matt
Hi,
thank you for your help and effort. Compiling just with "nmake build.libs" did help for the pantheios compile but not for my own code. I narrowed the problem down though to the order of two include statements.
In one of my header files i had this:
#include <json_spirit.h>
#include <pantheios/pantheios.hpp>
which seamed to cause the mentioned compilation error. when i reorder the includes to
#include <pantheios/pantheios.hpp>
#include <json_spirit.h>
the error goes away.
The header file "json_spirit.h" belongs to the json spirit library. That's an implementation of a json parser using boost::spirit one can find at http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx (not my code).
At the moment I'm not able to tell what in json_spirit.h did cause the compilation error...
I am using pantheios and through it STLSoft, and received the same errors. I am not however using the json_spirit header, and the pantheios/pantheios.hpp is already at the top of my includes.
To get past this, I can modify line #156 of auto_buffer.hpp to remove the parenthesis, and the compilation works.
", divided_value = max_value < divided_value_ "
Sorry more info:
I was upgrading an existing working VS2008 pantheios logged application to VS2010 when i encountered this compile error. VS2010 does not seem to like the parenthesis around the condition clause, perhaps because it has other parens nested in it from the previous enum value?
I have the same problem when I worked on the vs2008 and vs 2010(using pantheios and boost together). In some cpp files, I must let the auto_buffer.hpp to be the first h file I included(that's works, but I don't know why??).