It is currently Sat Aug 22, 2020 2:02 pm


All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Compiling PolyVox on VS2008
PostPosted: Fri Mar 25, 2011 1:02 pm 

Joined: Thu Mar 10, 2011 2:36 pm
Posts: 4
I keep getting syntax errors when compiling PolyVoxCore, all related with the header of the class AStarPathFinder. Well I'm sure it's some stupid thing... but I'm struggling for a while with no success... it seems some problem with the template declaration. Any ideas?

error C2061: syntax error : identifier 'function' PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(137) : see reference to class template instantiation 'PolyVox::AStarPathfinderParams<VoxelType>' being compiled
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(66) : error C2059: syntax error : ')'
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(66) : error C2143: syntax error : missing ')' before ':'
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(129) : error C2143: syntax error : missing ';' before '<'
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(129) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(129) : error C2238: unexpected token(s) preceding ';'
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(136) : error C2143: syntax error : missing ';' before '<'
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(136) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\PolyVox\library\PolyVoxCore\include\AStarPathfinder.h(136) : error C2238: unexpected token(s) preceding ';'


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiling PolyVox on VS2008
PostPosted: Fri Mar 25, 2011 5:38 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
PolyVox uses parts of the upcoming C++0X standard (such as function) which are not provided by VS2008 (only VS2010). You should be able to work around this by using Boost. PolyVox doesn't use 'function' directly, instead it declares a typedef 'polyvox_function' in TypeDef.h which uses std::function when it's available and boost::function when it's not.

Make sure you have boost installed and that it's being found. If this doesn't work, it's possible that the boost::function syntax is different from the std::function syntax. I've never checked this because I don't use boost - I just hoped it would work. If you're good with boost then maybe you can work it out...

Failing that, the easiest solution is to edit 'library\PolyVoxCore\CMakeLists.txt' and remove 'include/AStarPathfinder.h' and 'include/AStarPathfinder.inl' and 'source/AStarPathfinder.cpp'. That should work for now because nothing else depends on those files. However, in the future we are making more use of 'function'.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiling PolyVox on VS2008
PostPosted: Sun Mar 27, 2011 10:17 am 

Joined: Thu Mar 10, 2011 2:36 pm
Posts: 4
Thanks for the quick reply... I'm compiling polyvox in three different operating systems, so I had to remove the C++0x feature that was not running in OSX, and use boost instead. I realized that in the file TypeDef.h, the header in line 48:

#include <boost/functional.hpp>

does not include the boost::function and there's an error. That was the reason why the compiler complained about AStarPathFinder. I solved it by including instead,

#include <boost/function.hpp>

I wonder if that was a typo or a silly mistake. Or maybe my boost version (1_44) has slightly changed the location of the "function wrapper".


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiling PolyVox on VS2008
PostPosted: Sun Mar 27, 2011 11:00 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
It's just a mistake... I don't use Boost myself so I would probably just have guessed what the header file was called. So all you have to do is change that header and it works properly with Boost? I will make that change to SVN when I am back at my development machine.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiling PolyVox on VS2008
PostPosted: Sun Mar 27, 2011 11:30 am 

Joined: Thu Mar 10, 2011 2:36 pm
Posts: 4
Yes that's it... I got it compiled in Mac OS X Leopard and samples running fine. :D


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Compiling PolyVox on VS2008
PostPosted: Sun Mar 27, 2011 7:21 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, I've committed this to the trunk (untested). Thanks for the heads up :)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net