Problems while upgrading Ogre from 1.8 to 1.12

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
AdityaM
Gnoblar
Posts: 5
Joined: Thu Oct 03, 2019 6:08 am

Problems while upgrading Ogre from 1.8 to 1.12

Post by AdityaM » Thu Oct 03, 2019 6:31 am

Hi

In the OgreSharePtr.h and the SharedPtr class , i am continuously running into a error that im unable to solve , while trying to upgrade from OgreVersion (1.8.) to (1.12). from a project in Vs2008 to Vs 2015+

There have been implementations of shared pointers in the new Version and are absent in the old. But my attempts to upgrade are causing issues.
I tried building and rebuilding with cmake with newer version and the !same dependencies!.<---(this point im currently looking into).

Some places i scrutinized to no avail, were the Target Platform version, the Compiler version , The changes in the OgresharedPointer,the older version had no

Code: Select all

SharedPtr(std::nullptr_t){}
inside it.

The Errors are :

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'std::shared_ptr<T>::shared_ptr(std::shared_ptr<T> &&) noexcept': cannot convert argument 1 from 'const Ogre::SharedPtr<Ogre::Material>' to 'std::nullptr_t'	Lib_DT	f:\3dProj\ogre\ogre-1.12.1\ogremain\include\OgreSharedPtr.h	69	

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'std::shared_ptr<T>::shared_ptr(std::shared_ptr<T> &&) noexcept': cannot convert argument 1 from 'const Ogre::SharedPtr<Ogre::Resource>' to 'std::nullptr_t'	Lib_DT	f:\3dProj\ogre\ogre-1.12.1\ogremain\include\OgreSharedPtr.h	69	
Would love a nudge in the right direction. :roll:
Last edited by AdityaM on Wed Oct 16, 2019 8:14 am, edited 1 time in total.
0 x

AdityaM
Gnoblar
Posts: 5
Joined: Thu Oct 03, 2019 6:08 am

Re: Problems while upgrading Ogre from 1.8 to 1.12

Post by AdityaM » Thu Oct 03, 2019 1:14 pm

Update: So i did a separate build and Compile for the 2017 version instead of the 2015.
Errors :

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2039	'isNull': is not a member of 'std::shared_ptr<Ogre::Material>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	158	
Error	C2039	'getPointer': is not a member of 'std::shared_ptr<Ogre::Mesh>'	Lib_DT	f:\3dProj\lib_dt\sources\3dkmesh.cpp	405	
Error	C2039	'getPointer': is not a member of 'std::shared_ptr<Ogre::Mesh>'	Lib_DT	d:\3dkupgrade2017\3dk_source\lib_dt\sources\3dkmesh.cpp	398	
Error	C2039	'getPointer': is not a member of 'std::shared_ptr<Ogre::Mesh>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	179	
Error	C2039	'isNull': is not a member of 'std::shared_ptr<Ogre::Material>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	254	
Error	C2039	'isNull': is not a member of 'std::shared_ptr<Ogre::Material>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	259	
Error	C2440	'initializing': cannot convert from 'Ogre::MaterialPtr' to 'std::shared_ptr<Ogre::GpuProgramParameters>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	315	
Error	C2440	'initializing': cannot convert from 'Ogre::MaterialPtr' to 'std::shared_ptr<Ogre::GpuProgramParameters>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	734	
Error	C2039	'isNull': is not a member of 'std::shared_ptr<Ogre::Material>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	1133	
Error	C2440	'initializing': cannot convert from '_Ty1' to 'std::shared_ptr<Ogre::Material>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	1139	
Error	C2039	'isNull': is not a member of 'std::shared_ptr<Ogre::Material>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	1151	
Error	C2440	'initializing': cannot convert from 'Ogre::MaterialPtr' to 'std::shared_ptr<Ogre::GpuProgramParameters>'	Lib_DT	f:\3dProj\lib_dt\sources\ct_3dkmesh.cpp	1244	
Come up

And it give some direction to the fact that

Code: Select all

 Ogre::SharedPtr
is deprecated.

as it has removed them from compilation via the directive #if OGRE_USE_STD11

Code: Select all

#if OGRE_USE_STD11
    struct SPFMDeleteT {
        template<class T>
        void operator()(T* p) {
            OGRE_DELETE_T(p, T, MEMCATEGORY_GENERAL);
        }
    };
    const SPFMDeleteT SPFM_DELETE_T;

    struct SPFMNone {
        void operator()(void*) {}
    };
    const SPFMNone SPFM_NONE;

    using std::static_pointer_cast;
    using std::dynamic_pointer_cast;
#else
Last edited by AdityaM on Wed Oct 16, 2019 8:16 am, edited 1 time in total.
0 x

User avatar
luis
Greenskin
Posts: 119
Joined: Tue Mar 02, 2004 3:33 pm
Location: Spain / Argentina
x 4
Contact:

Re: Problems while upgrading Ogre from 1.8 to 1.12

Post by luis » Thu Oct 10, 2019 5:00 pm

I'm using vs2019 + Ogre 1.12.1 and I can use Ogre::SharedPtr with compiler warnings (no errors).
Are you using a compiler option that treats warnings as errors ?
0 x

AdityaM
Gnoblar
Posts: 5
Joined: Thu Oct 03, 2019 6:08 am

Re: Problems while upgrading Ogre from 1.8 to 1.12

Post by AdityaM » Fri Oct 11, 2019 6:47 am

luis wrote:
Thu Oct 10, 2019 5:00 pm
I'm using vs2019 + Ogre 1.12.1 and I can use Ogre::SharedPtr with compiler warnings (no errors).
Are you using a compiler option that treats warnings as errors ?
This is an update to my problem , which i manged to resolve. Just for the logs. :mrgreen:

I am using the old implementations of <OgreSharedPtr> which uses its in house methods instead of its newer use of the std::smartpointers

I did a downgrade to the version, and used Ogre 1.10 instead, interestingly , this version had completely removed the inhouse implementation via compiler directive #if OGRE_USE_STD11, and used std::smart-pointers instead (which they later,in subsequent versions, changed back to how it was, for backward compatibility and just put a /*comment that this was deprecated*/).
Image this option will only come up in 1.10

Since in 1.10 the methods were removed, i could tell exactly where the functions were breaking , and hence the changes that were needed were easy to do.(This is somewhat of a substantial code base).

So as far as this problem is concerned , its all in the clear.
0 x

Post Reply