Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Error in compiling program with "-std=c++0x" option
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=421
Page 1 of 1

Author:  ams [ Tue Aug 14, 2012 8:30 am ]
Post subject:  Error in compiling program with "-std=c++0x" option

Hi. I'm exploring Polyvox for managing large worlds of the order of 100kms wide with a resolution of 10cm. I'm working on an application which uses OGRE for visualization. I'm using the Qt development environment (Qt 4.7.3 (64 bit), Qt Creator 2.2.1). After I included Polyvox in my project, I got an error as follows:
Quote:
#error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.

Then I added this flag to my Qt project (.pro) file:
Quote:
QMAKE_CXXFLAGS += -std=c++0x

Now I'm getting the following error:
Quote:
#error: no matching function for call to ‘Ogre::STLAllocator<Ogre::Terrain::LayerInstance, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0u> >::construct(Ogre::Terrain::LayerInstance*)’

I'm using the OGRE Terrain System for ground and want to manage non-ground object points with Polyvox::LargeVolume. Any help with the above error will be greatly appreciated. Thanks in advance.

Author:  David Williams [ Tue Aug 14, 2012 8:40 am ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

So is the Ogre error actually a result of adding the -std=c++0x flag? Or was it going to have this error anyway, but you weren't getting that far because you nit the PolyVox error first? What happens if you remove PolyVox from the project but still specify this flag?

It seems this could be a C++0x/Ogre issue rather than a PolyVox issue?

Author:  ams [ Tue Aug 14, 2012 9:52 am ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

For my initial OGRE program, I didn't need to specify the flag. Though if I add the flag (excluding Polyvox from my project) I get the second OGRE error. After including Polyvox in my code, without the flag, I get the first error.

Author:  David Williams [ Tue Aug 14, 2012 11:37 am ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

This isn't really a problem with PolyVox then, and you should instead try to find out why that flag is not compatable with Ogre. Maybe ask on the Ogre forums to see if anyone has any ideas?

Author:  ams [ Tue Aug 14, 2012 12:32 pm ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

I made a separate project, and included just one polyvox header "PolyVoxCore/VertexTypes.h" in the main file. The main function is empty and does nothing. Without QMAKE_CXXFLAGS += -std=c++0x, the program doesn't compile and throws this error:
Quote:
#error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.

Isn't there a workaround to compile PolyVox without this flag?

Author:  David Williams [ Tue Aug 14, 2012 12:52 pm ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

Yes, PolyVox uses only a few pieces of C++0x (std::function, std::shared_ptr, etc) and these can be replaced by the Boost equivilents. Actually, we already do this on VS2008 as that compiler doesn't support C++0x. Have a look at PolyVoxImpl/TypeDefs.h to see how this is done. You'll need Boost installed and you'll need to make a few changes to that header. This Boost solution is not well tested, however.

Author:  Freakazo [ Wed Aug 15, 2012 12:15 am ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

Out of curiosity which compiler and version are you using?

Author:  ams [ Thu Aug 16, 2012 7:56 am ]
Post subject:  Re: Error in compiling program with "-std=c++0x" option

I'm using gcc-4.6, QMake version 2.01a, Qt version 4.7.4

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/