It is currently Sat Aug 22, 2020 1:34 pm


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Error in compiling program with "-std=c++0x" option
PostPosted: Tue Aug 14, 2012 8:30 am 

Joined: Mon Aug 13, 2012 1:22 pm
Posts: 4
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Tue Aug 14, 2012 8:40 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Tue Aug 14, 2012 9:52 am 

Joined: Mon Aug 13, 2012 1:22 pm
Posts: 4
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Tue Aug 14, 2012 11:37 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Tue Aug 14, 2012 12:32 pm 

Joined: Mon Aug 13, 2012 1:22 pm
Posts: 4
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?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Tue Aug 14, 2012 12:52 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Wed Aug 15, 2012 12:15 am 

Joined: Sat Dec 18, 2010 2:58 am
Posts: 41
Out of curiosity which compiler and version are you using?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Error in compiling program with "-std=c++0x" option
PostPosted: Thu Aug 16, 2012 7:56 am 

Joined: Mon Aug 13, 2012 1:22 pm
Posts: 4
I'm using gcc-4.6, QMake version 2.01a, Qt version 4.7.4


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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