Compiling Hydrax 0.5.1 with Ogre 1.7 (Cthuga)

Illidanz

22-09-2009 21:08:03

Here's a quick guide to compile the new Hydrax with the new Ogre.

Note that the changes are backwards compatible, so they will work con 1.6 too

SimpleGrid.cpp line 305 change
mHydrax->getMesh()->getEntity()->getParentSceneNode()->getWorldTransforms(&mWorldMatrix);
with
#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7
mWorldMatrix = mHydrax->getMesh()->getEntity()->getParentSceneNode()->_getFullTransform();
#else
mHydrax->getMesh()->getEntity()->getParentSceneNode()->getWorldTransforms(&mWorldMatrix);
#endif


Mesh.cpp line 414 change
mEntity->getParentSceneNode()->getWorldTransforms(&mWorldMatrix);
with
#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7
mWorldMatrix = mEntity->getParentSceneNode()->_getFullTransform();
#else
mEntity->getParentSceneNode()->getWorldTransforms(&mWorldMatrix);
#endif


a couple of lines after change
mTmpSN->getWorldTransforms(&mWorldMatrix);
with
#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7
mWorldMatrix = mTmpSN->_getFullTransform();
#else
mTmpSN->getWorldTransforms(&mWorldMatrix);
#endif


again in the same file, change
mEntity->getParentSceneNode()->getWorldTransforms(&mWorldMatrix);
with
#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7
mWorldMatrix = mEntity->getParentSceneNode()->_getFullTransform();
#else
mEntity->getParentSceneNode()->getWorldTransforms(&mWorldMatrix);
#endif


and
mTmpSN->getWorldTransforms(&mWorldMatrix);
with
#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7
mWorldMatrix = mTmpSN->_getFullTransform();
#else
mTmpSN->getWorldTransforms(&mWorldMatrix);
#endif


Last, in CfgFileManager.cpp line 305 change
std::vector<Ogre::String> Cmpnts = Ogre::StringUtil::split(CfgFile.getSetting("Components"), "|");
to
Ogre::StringVector Cmpnts = Ogre::StringUtil::split(CfgFile.getSetting("Components"), "|");

and change the parameter of the function _isStringInList from std::vector<Ogre::String> to Ogre::StringVector too, in both CfgFileManager.h and CfgFileManager.cpp

Darkeye

07-12-2009 08:22:39

Worked Great, thanks, I think its recommendable to put a link to this in the Main post of Hydrax. :mrgreen:

geekanovel

18-03-2010 14:08:07

Hi, All,

I was trying to compile Hydrax-5-0-1 with Ogre 1.65 in Visual Studio 2008 Express, But there is no .sln (Solution file) for MSVS2008. I tried to convert using the wizard in MSVS. But it didnt compiles, saying some header files are missing.

Can anybody help me on this prob

-GeekaNovel

SFCBias

04-05-2010 20:26:26

thank you very much for this. It saved me ALOT of time.

Note that also in the last file we had to edit. There needs to be a change from
bool CfgFileManager::_isStringInList(const std::vector<Ogre::String> &List, const Ogre::String &Find)

to
bool CfgFileManager::_isStringInList(const Ogre::StringVector &List, const Ogre::String &Find)

CodeKrash

09-01-2011 03:20:21

compiled for your pleasure: [attachment=0]Hydrax051_Ogre171.rar[/attachment]

narugohan

19-01-2011 14:44:10

Hello all,
I would like to use Hydrax 0.5.1 with Ogre 1.7.1 . I tried to compile Hydrax 0.5.1 with Ogre 1.7.1, but I had errors. I followed your explication, and I have managed.... almost.
" libHydrax.dll.a " created, but I have many errors and not .dll :

-------------- Build: Release in Hydrax ---------------

Linking dynamic library: bin\Release\Hydrax.dll
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x0): multiple definition of `Hydrax::Hydrax::isComponent(Hydrax::HydraxComponent const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x0): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x38): multiple definition of `Hydrax::Hydrax::setPlanesError(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x38): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x7c): multiple definition of `Hydrax::Hydrax::setShaderMode(Hydrax::MaterialManager::ShaderMode const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x7c): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0xec): multiple definition of `Hydrax::Hydrax::setPolygonMode(Ogre::PolygonMode const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0xec): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x18c): multiple definition of `Hydrax::Hydrax::DeviceListener::eventOccurred(std::string const&, std::map<std::string, std::string, std::less<std::string>, Ogre::STLAllocator<std::pair<std::string const, std::string>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > > const*)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x18c): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x1bc): multiple definition of `Hydrax::Hydrax::remove()'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x1bc): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x410): multiple definition of `Hydrax::Hydrax::_checkUnderwater(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x410): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0xc44): multiple definition of `Hydrax::Hydrax::update(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0xc44): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0xc9c): multiple definition of `Hydrax::Hydrax::_checkVisible()'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0xc9c): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0xe24): multiple definition of `Hydrax::Hydrax::setVisible(bool const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0xe24): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0xe3c): multiple definition of `Hydrax::Hydrax::setWaterColor(Ogre::Vector3 const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0xe3c): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x1c8c): multiple definition of `Hydrax::Hydrax::~Hydrax()'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x1c8c): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x1fb4): multiple definition of `Hydrax::Hydrax::~Hydrax()'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x1fb4): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x22dc): multiple definition of `Hydrax::Hydrax::Hydrax(Ogre::SceneManager*, Ogre::Camera*, Ogre::Viewport*)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x22dc): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x2830): multiple definition of `Hydrax::Hydrax::Hydrax(Ogre::SceneManager*, Ogre::Camera*, Ogre::Viewport*)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x2830): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x2d84): multiple definition of `Hydrax::Hydrax::setDepthLimit(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x2d84): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x2f04): multiple definition of `Hydrax::Hydrax::setComponents(Hydrax::HydraxComponent const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x2f04): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x4a58): multiple definition of `Hydrax::Hydrax::create()'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x4a58): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x6340): multiple definition of `Hydrax::Hydrax::setCausticsEnd(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x6340): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x6484): multiple definition of `Hydrax::Hydrax::setGlobalTransparency(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x6484): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x66d4): multiple definition of `Hydrax::Hydrax::_setStrength(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x66d4): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x68e0): multiple definition of `Hydrax::Hydrax::setSunColor(Ogre::Vector3 const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x68e0): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x6af0): multiple definition of `Hydrax::Hydrax::setSunPosition(Ogre::Vector3 const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x6af0): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x6d48): multiple definition of `Hydrax::Hydrax::rotate(Ogre::Quaternion const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x6d48): first defined here
obj\Release\src\Hydrax\hydrax.o:hydrax.cpp:(.text+0x6f74): multiple definition of `Hydrax::Hydrax::setSmoothPower(float const&)'
obj\Release\src\Hydrax\Hydrax.o:hydrax.cpp:(.text+0x6f74): first defined here
Process terminated with status 1 (0 minutes, 1 seconds)
50 errors, 0 warnings



I work with Code::Blocks.
Thank you in advance for your help


PS : Sorry for my english, I'm French and not very good in English

AndiNo

19-01-2011 15:16:40

Here's a quick guide to compile the new Hydrax with the new Ogre.
Thank you very much for this! This saved me a lot of time.
I hope you'll be ready when Ogre 1.8 comes out and Xavyiy doesn't find time to finally update Hydrax ;)

trilader

20-01-2011 18:47:04

Hello all,
I would like to use Hydrax 0.5.1 with Ogre 1.7.1 . I tried to compile Hydrax 0.5.1 with Ogre 1.7.1, but I had errors. I followed your explication, and I have managed.... almost.
" libHydrax.dll.a " created, but I have many errors and not .dll :

... SNIP ...

I work with Code::Blocks.
Thank you in advance for your help


PS : Sorry for my english, I'm French and not very good in English


I posted a kind of guide how to fix that as I had the same problem: Click here...

Regards:
-trilader

narugohan

20-01-2011 21:33:29

Thank you very mush for your help. I did't see your topic.

Thank you very mush
Good night

tdev

13-02-2011 11:43:40

uploaded a patched version: http://modclub.rigsofrods.com/xavi/hydr ... ed.tar.bz2

CodeKrash

14-02-2011 01:52:12

uploaded a patched version: http://modclub.rigsofrods.com/xavi/hydr ... ed.tar.bz2


0.5.2 != 0.5.1 Make a new thread?

CodeKrash

14-02-2011 02:46:50

Hydrax 0.5.1 patched for Ogre 1.7.1 and using VS 2010

nevarim

23-08-2011 08:58:19

it will be good thing to make a wiki tutorial page for hydrax ;)

MindCalamity

16-09-2011 00:01:16

Hydrax 0.5.1 patched for Ogre 1.7.1 and using VS 2010

Confirmed, this works with Byatis ( 1.8 ) + VS 2010 as well.