can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Particle

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Particle

Post by suny »

Ogre Version: Ogre 1.12 from 8th of august 2021
Operating System: windows 10

Hi'

I'm trying to build Particle Universe with the latest Ogre from Github, and I have this build error:
Error (active) E0503 member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::ParticleUniverseRoot]" cannot be specialized in the current scope ParticleUniverse C:\OgreSDK\_dependancies\particleuniverse-master\Plugins\ParticleUniverse\src\ParticleUniverseRoot.cpp 30

Does anyone know what I can do to fix this?
S.
LtZ
Gnoblar
Posts: 15
Joined: Thu Dec 19, 2019 9:51 am
x 11

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by LtZ »

Hello,

For some reason, in VS2015 at least I need to apply following changes to ParticleUniverseRoot.cpp to get it compile:

Code: Select all

------------ Plugins/ParticleUniverse/src/ParticleUniverseRoot.cpp ------------
index 5d7f35d..053985f 100644
@@ -25,11 +25,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "ParticleUniverseRoot.h"
 
 namespace ParticleUniverse
 {
-	template<> _ParticleUniverseExport
-	ParticleUniverseRoot* Ogre::Singleton<ParticleUniverseRoot>::msSingleton = 0;

 	//---------------------------------------------------------------------
 	void ParticleUniverseRoot::initialise()
 	{
 #ifdef PU_PHYSICS_PHYSX
@@ -384,4 +381,6 @@ namespace ParticleUniverse
 		PU_DELETE_T(mPhysXBridge, PhysXBridge, MEMCATEGORY_SCENE_CONTROL);
 #endif // PU_PHYSICS_PHYSX
 	}
 }

+template<> ParticleUniverse::ParticleUniverseRoot* Ogre::Singleton<ParticleUniverse::ParticleUniverseRoot>::msSingleton = 0;
I think bit older compilers don't like reference to namespace within that same namespace because its is not finished yet or something? So we move the msSingleton declaration out of the namespace.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by paroj »

LtZ wrote: Tue Aug 17, 2021 5:14 pm For some reason, in VS2015 at least I need to apply following changes to ParticleUniverseRoot.cpp to get it compile:
can you create a pull-request with that?
LtZ
Gnoblar
Posts: 15
Joined: Thu Dec 19, 2019 9:51 am
x 11

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by LtZ »

can you create a pull-request with that?
Not right now sorry, as it doesn't seem to compile with 13.0 anyway due to OgreRadixSort. I'll try to make sure it compile & work with 13.0 before doing anything further..
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by paroj »

both issues should be fixed in master
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by suny »

With Ogre 1.12.13 and VC 2019, and PU from master, I still have this error:

Code: Select all

Error	C2370	'msSingleton': redefinition; different storage class	ParticleUniverse	C:\OgreSDK\_dependancies\particleuniverse-master\Plugins\ParticleUniverse\src\ParticleUniverseRoot.cpp	29	
LtZ
Gnoblar
Posts: 15
Joined: Thu Dec 19, 2019 9:51 am
x 11

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by LtZ »

Today posted a pull request to fix the remaining issues.
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by suny »

Thanks a lot, I can compile PU now!
But when I start my project, I have this error:
Cannot find symbol dllStartPlugin in library ParticleUniverse
Did I forget to do something?
S.
LtZ
Gnoblar
Posts: 15
Joined: Thu Dec 19, 2019 9:51 am
x 11

Re: can't build particle universe with last Ogre: member "Ogre::Singleton<T>::msSingleton [with T=ParticleUniverse::Part

Post by LtZ »

You must link your executable against it's lib (target_link_libraries et al.), not try to load it thru plugins.cfg because it isn't a plugin.
Post Reply