Problem with PLSM2 build using Code:Blocks w. STLPort

Zvejk

31-05-2006 11:52:38

Hello, I have problem to build PLSM2 under Code::Blocks with mingw compiller and STLPort. When I configure build options like it is in OgreSDK samples, STLPort gives me errors like this:

../include/OgrePagingLandScapeQueue.h:194: error: call of overloaded `abs(unsigned int&)' is ambiguous
C:/CodeBlocks/include/../include/stdlib.h:367: note: candidates are: int abs(int)
c:/OgreSDK/stlport/stlport/cstdlib:116: note: long int abs(long int)
c:/OgreSDK/stlport/stlport/cstdlib:133: note: long long int abs(long long int)
c:/OgreSDK/stlport/stlport/stl/_cmath.h:226: note: double abs(double)
c:/OgreSDK/stlport/stlport/stl/_cmath.h:229: note: float abs(float)
c:/OgreSDK/stlport/stlport/stl/_cmath.h:229: note: long double abs(long double)
../include/OgrePagingLandScapeQueue.h:194: error: call of overloaded `abs(unsigned int&)' is ambiguous
C:/CodeBlocks/include/../include/stdlib.h:367: note: candidates are: int abs(int)
c:/OgreSDK/stlport/stlport/cstdlib:116: note: long int abs(long int)
c:/OgreSDK/stlport/stlport/cstdlib:133: note: long long int abs(long long int)
c:/OgreSDK/stlport/stlport/stl/_cmath.h:226: note: double abs(double)
c:/OgreSDK/stlport/stlport/stl/_cmath.h:229: note: float abs(float)
c:/OgreSDK/stlport/stlport/stl/_cmath.h:229: note: long double abs(long double)


When remove linking of the STLPort, PLSM2 compiles, but it does not link into DLL. It displays errors like "undefined object xxx in aaaaa.o".

I would be very thankfull for any advice or example project, which will help me to build PLSM2.

tuan kuranes

31-05-2006 12:05:06

To get this one fixed, replace the error line by this one :

const unsigned int res = abs ((int)(lx - x)) + abs ((int)(lz - z));

I'll add this fix and other coming in CVS asap.

Zvejk

31-05-2006 15:36:39

To get this one fixed, replace the error line by this one :

const unsigned int res = abs ((int)(lx - x)) + abs ((int)(lz - z));

I'll add this fix and other coming in CVS asap.


Yes, this line solved the problem with compilation of c++ files into objects.

The second one, linking is still not working, it looks like its not linking to dynamic OGRE libraries(OgreMain.dll and libstlport.5.0.dll), cause it stops on displaying these error messages:


:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:51: undefined reference to `_imp___ZN8stlp_std6localeC1Ev'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:60: undefined reference to `_imp___ZN8stlp_std6localeD1Ev'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:60: undefined reference to `_imp___ZN8stlp_std6localeD1Ev'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:51: undefined reference to `_imp___ZN8stlp_std13_Filebuf_base7_M_seekExi'
\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:61: undefined reference to `_imp___ZN8stlp_std13_Filebuf_base7_M_seekExi'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:61: undefined reference to `_imp___ZN8stlp_std13_Filebuf_base7_M_seekExi'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:61: undefined reference to `_imp___ZN8stlp_std13_Filebuf_base7_M_seekExi'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:70: undefined reference to `_imp___ZN8stlp_std13_Filebuf_base7_M_seekExi'
..\obj\Release\src\OgrePagingLandScapeData2D_HeightFieldRaw.o:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeData2D_HeightFieldRaw.cpp:74: more undefined references to `_imp___ZN8stlp_std13_Filebuf_base7_M_seekExi' follow
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:55: undefined reference to `Ogre::OcclusionElement::OcclusionElement()'
\src\OgrePagingLandScapeOctree.cpp:57: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:112: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:112: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:112: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:112: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
..\obj\Release\src\OgrePagingLandScapeOctree.o:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:112: more undefined references to `Ogre::OcclusionElement::~OcclusionElement()' follow
\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:341: undefined reference to `Ogre::OcclusionBoundingBox::setupBoundingBox(Ogre::AxisAlignedBox const&)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:437: undefined reference to `Ogre::OcclusionBoundingBox::OcclusionBoundingBox()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctree.cpp:439: undefined reference to `Ogre::OcclusionBoundingBox::setupBoundingBox(Ogre::AxisAlignedBox const&)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:56: undefined reference to `Ogre::OcclusionElement::OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:56: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:68: undefined reference to `Ogre::OcclusionElement::OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:68: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:68: undefined reference to `Ogre::OcclusionElement::OcclusionElement()'
:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:68: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:78: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:78: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:78: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:78: undefined reference to `Ogre::OcclusionElement::~OcclusionElement()'
..\obj\Release\src\OgrePagingLandScapeOctreeNode.o:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:78: more undefined references to `Ogre::OcclusionElement::~OcclusionElement()' follow
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:111: undefined reference to `Ogre::OcclusionBoundingBox::setupBoundingBox(Ogre::AxisAlignedBox const&)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:319: undefined reference to `Ogre::OcclusionBoundingBox::OcclusionBoundingBox()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeNode.cpp:321: undefined reference to `Ogre::OcclusionBoundingBox::setupBoundingBox(Ogre::AxisAlignedBox const&)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:332: undefined reference to `Ogre::Occlusion::Occlusion(unsigned int)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:332: undefined reference to `Ogre::Occlusion::Occlusion(unsigned int
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:342: undefined reference to `Ogre::Occlusion::Occlusion(unsigned int)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:342: undefined reference to `Ogre::Occlusion::Occlusion(unsigned int)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:851: undefined reference to `Ogre::Occlusion::nextFrame(Ogre::PagingLandScapeOctreeCamera*, stlp_std::list<Ogre::MovableObject*, stlp_std::allocator<Ogre::MovableObject*> >*, bool, Ogre::RenderQueue*)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:861: undefined reference to `Ogre::Occlusion::CHCtraversal(Ogre::PagingLandScapeOctree*)'
:881:: undefined reference to `Ogre::Occlusion::CHCtraversalConservative(Ogre::PagingLandScapeOctree*)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeOctreeSceneManager.cpp:936: undefined reference to `Ogre::ViewFrustumCullingTraversalDirect::ViewFrustumCullingTraversalDirect(Ogre::Occlusion&)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeRenderable.cpp:241: undefined reference to `Ogre::PagingLandScapeTextureCoordinatesManager::getBuffer(unsigned int, unsigned int)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeSceneManager.cpp:233: undefined reference to `Ogre::PagingLandScapeTextureCoordinatesManager::PagingLandScapeTextureCoordinatesManager(Ogre::PagingLandScapeSceneManager*)'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeSceneManager.cpp:262: undefined reference to `Ogre::PagingLandScapeTextureCoordinatesManager::load()'
:C:\OgreSDK\PlugIns\PagingLandScape2\scripts\..\src\OgrePagingLandScapeTexture_Splatting.cpp:49: undefined reference to `_imp___ZN8stlp_std24__stl_throw_length_errorEPKc'


Please, do you have any suggestions what to set up? I have almost same settings as in the Ogre Samples.

Zvejk

01-06-2006 07:00:52

So, when I explored the problem deeper, I found out, that it is something else. Linker works properly and finds OgreMain and STLPort DLL's, but it cannot find some classes(OcclusionElement, OcclusionBoundingBox) or functions(getBuffer(), load()) from PLSM2 in the compilled objects. I think, that any cpp file is not included in the Code::Blocks project and thats why I cannot link PLSM2.

Edit: In more detail, OgrePagingLandScapeOctree.cpp file requires classes and functions related to Occlusion, but it references only to:

#include "OgreOcclusionBoundingBox.h"

In this header file there is no reference to OcclusionElement. And no CPP file or header is included in Code::Blocks project file.

Zvejk

01-06-2006 12:55:37

So, I found out solution of my problem. Here is the what I had to change to get the CB project work:

1. I had to change "Build options". I used the same settings as can be found in OgreSDK samples or in OgreWiki. In my project was included STLPort, but I think, that building of the project is possible also without that.

2. In file OgrePagingLanScapeQueue.h we have to change line 194 to this:

const unsigned int res = abs ((int)(lx - x)) + abs ((int)(lz - z));

3. The files should compile without problem, but the linking will crash on undefined symbols. You will have to include some files into your project and then it will work well. Here is list of the files you need:

Sources:

]OgreOcclusionBoundingBox.cpp
OgrePagingLandScapeOcclusion.cpp
OgrePagingLandScapeOcclusionCameraTraversal.cpp
OgrePagingLandScapeOcclusionCHCTraversal.cpp
OgrePagingLandScapeOcclusionDebugTraversal.cpp
OgrePagingLandScapeOcclusionElement.cpp
OgrePagingLandScapeOcclusionQuerySet.cpp
OgrePagingLandScapeOcclusionSWTraversal.cpp
OgrePagingLandScapeOcclusionTraversal.cpp
OgrePagingLandScapeOcclusionVFTraversal.cpp
OgrePagingLandScapeTextureCoordinatesManager.h


Headers:
]OgreOcclusionBoundingBox.h
OgrePagingLandScapeOcclusion.h
OgrePagingLandScapeOcclusionCameraTraversal.h
OgrePagingLandScapeOcclusionCHCTraversal.h
OgrePagingLandScapeOcclusionDebugTraversal.h
OgrePagingLandScapeOcclusionElement.h
OgrePagingLandScapeOcclusionQuerySet.h
OgrePagingLandScapeOcclusionSWTraversal.h
OgrePagingLandScapeOcclusionTraversal.h
OgrePagingLandScapeOcclusionVFTraversal.h
OgrePagingLandScapeTextureCoordinatesManager.h

tuan kuranes

01-06-2006 15:11:18

can you mail modified CB them to me ?

Zvejk

02-06-2006 06:07:45

can you mail modified CB them to me ?

Yes, sure. I will use the email address in your profile.

EDIT: Sent.

And one more question. Is there any tutorial or documentation, how to use PLSM2? I mean except the sample app included in PLSM2 SDK.

tuan kuranes

02-06-2006 08:45:56

try those, and ask about anything unclear :
http://www.ogre3d.org/wiki/index.php/Pa ... ne_Manager
http://www.ogre3d.org/wiki/index.php/Cr ... pplication

Zvejk

02-06-2006 09:36:26

try those, and ask about anything unclear :
http://www.ogre3d.org/wiki/index.php/Pa ... ne_Manager
http://www.ogre3d.org/wiki/index.php/Cr ... pplication


Well, I know about these pages and read them. But for me its a bit too general. It would be great if something like Ogre tutorials would exist. I mean step by step building the example PLSM application. Now I can only look at the sample code(mostly without comments) and try to guess, what part of code does and how it is implemented into Ogre main code.

jacmoe

02-06-2006 09:38:17

Contributions are always welcome, Zvejk! :)

Zvejk

02-06-2006 09:51:04

Contributions are always welcome, Zvejk! :)

Well, yes, You are absolutely right. :P

I'm not against writting any tutorial for Ogre or PLSM, but first I have to gain a bit more advanced level of knowledge. I know Ogre in on intermediate level, but does not know anything about PLSM(except general principles).

tuan kuranes

02-06-2006 10:33:05

I'm not expert on tutorial, but if you can set up the "skeleton" of it with question inside each part, we can try a collaborative work on a tutorial.

Zvejk

02-06-2006 13:26:41

I'm not expert on tutorial, but if you can set up the "skeleton" of it with question inside each part, we can try a collaborative work on a tutorial.

Ok, thats not problem. I will prepare the "skeleton". 8)

dedesite

09-06-2006 15:15:58

I made all what you say Zvejk, but I still have the same error, wich is here :

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1200

I use Ogre 1.2.0 (not the SDK) and I configure my project as it is advice in the wiki.

Can you send me the CBP file please?

Thanks,

dede

Zvejk

13-06-2006 12:14:42

I made all what you say Zvejk, but I still have the same error, wich is here :

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1200

I use Ogre 1.2.0 (not the SDK) and I configure my project as it is advice in the wiki.

Can you send me the CBP file please?

Thanks,

dede


Hello. Sorry for late answer, was out for a week. Well, i don't know, if the settings will work for you. I am using latest version of OgreSDK 1.2 with STL and latest PLSM2 sources. But sure, I will send you link to the whole project when i am at home today. I dont have access to my ftp site right now. Or write me your email and i will send it thru email.

To Tuan Kuranes: The tutorial skeleton is almost done. On friday i will send that to you.

Chapiscado

08-08-2013 18:19:09

Zvejk

Can you send me the CBP file please?

Thanks,

mary

08-08-2016 11:37:50

So, when I explored the problem deeper, I found out, that it is something else. Linker works properly and finds OgreMain and STLPort DLL's, but it cannot find some classes(OcclusionElement, OcclusionBoundingBox) or functions(getBuffer(), load()) from PLSM2 in the compilled objects. I think, that any cpp file is not included in the Code::Blocks project and thats why I cannot link PLSM2.