2.0 build error on MinGW-W64 GCC 9.2.0

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
libolt
Halfling
Posts: 72
Joined: Wed Jan 19, 2005 4:48 am
x 1

2.0 build error on MinGW-W64 GCC 9.2.0

Post by libolt » Thu Sep 05, 2019 6:06 am

So now that I'm attempting to port my code to 2.0 I have downloaded the latest version of it from mercurial using the v2-0 branch. I'm building with MinGW-W64 and gcc 9.2.0 on windows 10. The following is the error I get when building RenderSystem_GL.

Code: Select all

$ mingw32-make
[ 47%] Built target OgreMain
[ 48%] Building CXX object RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/Win32/OgreWin32Window.cpp.obj
C:\Users\libolt\Nextcloud\builds\sources\ogre-2.0\RenderSystems\GL\src\Win32\OgreWin32Window.cpp: In member function 'virtual void Ogre::Win32Window::create(const String&, unsigned int, unsigned int, bool, const NameValuePairList*)':
C:\Users\libolt\Nextcloud\builds\sources\ogre-2.0\RenderSystems\GL\src\Win32\OgreWin32Window.cpp:261:59: error: call of overloaded 'toString(DWORD&)' is ambiguous
  261 |                     + ::Ogre::StringConverter::toString(le)
      |                                                           ^
In file included from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreRenderSystemCapabilities.h:34,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreRenderSystem.h:37,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreSceneManager.h:48,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreSceneManagerEnumerator.h:33,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreRoot.h:34,
                 from C:\Users\libolt\Nextcloud\builds\sources\ogre-2.0\RenderSystems\GL\src\Win32\OgreWin32Window.cpp:33:
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:69:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(Ogre::Real, short unsigned int, short unsigned int, char, std::ios_base::fmtflags)'
   69 |         static String toString(Real val, unsigned short precision = 6,
      |                       ^~~~~~~~
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:83:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(double, short unsigned int, short unsigned int, char, std::ios_base::fmtflags)'
   83 |         static String toString(double val, unsigned short precision = 6,
      |                       ^~~~~~~~
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:102:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(int, short unsigned int, char, std::ios_base::fmtflags)'
  102 |         static String toString(int val, unsigned short width = 0,
      |                       ^~~~~~~~
In file included from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreRenderSystemCapabilities.h:34,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreRenderSystem.h:37,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreSceneManager.h:48,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreSceneManagerEnumerator.h:33,
                 from C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreRoot.h:34,
                 from C:\Users\libolt\Nextcloud\builds\sources\ogre-2.0\RenderSystems\GL\src\Win32\OgreWin32Window.cpp:33:
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:107:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(unsigned int, short unsigned int, char, std::ios_base::fmtflags)'
  107 |         static String toString(unsigned int val,
      |                       ^~~~~~~~
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:111:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(size_t, short unsigned int, char, std::ios_base::fmtflags)'
  111 |         static String toString(size_t val,
      |                       ^~~~~~~~
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:131:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(long int, short unsigned int, char, std::ios_base::fmtflags)'
  131 |         static String toString(long val,
      |                       ^~~~~~~~
C:/Users/libolt/Nextcloud/builds/sources/ogre-2.0/OgreMain/include/OgreStringConverter.h:137:23: note: candidate: 'static Ogre::String Ogre::StringConverter::toString(bool, bool)'
  137 |         static String toString(bool val, bool yesNo = false);
      |                       ^~~~~~~~
mingw32-make[2]: *** [RenderSystems\GL\CMakeFiles\RenderSystem_GL.dir\build.make:553: RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/Win32/OgreWin32Window.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:183: RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/all] Error 2
mingw32-make: *** [Makefile:151: all] Error 2
0 x

rujialiu
Goblin
Posts: 224
Joined: Mon May 09, 2016 8:21 am
x 20

Re: 2.0 build error on MinGW-W64 GCC 9.2.0

Post by rujialiu » Mon Sep 09, 2019 5:24 am

libolt wrote:
Thu Sep 05, 2019 6:06 am
So now that I'm attempting to port my code to 2.0 I have downloaded the latest version of it from mercurial using the v2-0 branch. I'm building with MinGW-W64 and gcc 9.2.0 on windows 10. The following is the error I get when building RenderSystem_GL.
Have you tried an older version of Ogre 2.0? Since you're porting to Ogre 2.0 JUST AS AN INTERMEDIATE STEP towards 2.1/2.2, you don't have to use the latest one. Maybe some older version compiles with MinGW-W64? 8-) I never used MinGW-W64 though.... maybe using an old version of gcc also solves the problem?
0 x

libolt
Halfling
Posts: 72
Joined: Wed Jan 19, 2005 4:48 am
x 1

Re: 2.0 build error on MinGW-W64 GCC 9.2.0

Post by libolt » Mon Sep 09, 2019 10:34 pm

I'm happy to try an older version of Ogre 2.0 but I can't seem to find a place to download it from. The issue with downgrading GCC is that I install it via msys2 which uses the Pacman repository manager (I believe from Arch Linux originally) and I don't believe it's easy to downgrade packages.

I did manage to get 2.0 to compile by disabling both RenderSystem_GL and OgreXMLConverter (by not manually setting TINYXML_INCLUDE_DIR and TINYXML_LIBRARIES, which I had set to use my own build of tinyxml2 I use for my project). So as long as I can use the V1 meshes and get the GL3Plus renderer working I should be able to port the code.
0 x

libolt
Halfling
Posts: 72
Joined: Wed Jan 19, 2005 4:48 am
x 1

Re: 2.0 build error on MinGW-W64 GCC 9.2.0

Post by libolt » Tue Sep 10, 2019 12:39 am

Well I fixed the OgreXMLConverter build by intalling the package for TinyXML from the msys2 repo. I was trying to force it to use TinyXML2 when it needed version 1.
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4066
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 228
Contact:

Re: 2.0 build error on MinGW-W64 GCC 9.2.0

Post by dark_sylinc » Tue Sep 10, 2019 4:07 pm

Some users have contributed patches to make Ogre 2.1 compile in MinGW

I suggest you look at the files that are giving compile errors, fetch its Ogre 2.1 and see the differences. Looking at the file's history may also isolate the commit that fixed the error.

It's likely OgreStringConverter.h got patched. That file didn't change much between 2.0 and 2.1, start there.

Cheers
Matias
0 x

libolt
Halfling
Posts: 72
Joined: Wed Jan 19, 2005 4:48 am
x 1

Re: 2.0 build error on MinGW-W64 GCC 9.2.0

Post by libolt » Tue Sep 10, 2019 10:57 pm

dark_sylinc,

Thanks, I patched 2.0 with the parseBool function from 2.1. That appears to be the only change in OgreStringConverter when I ran diff. Unfortunately it didn't work.I'm still getting the same error

On another note have btOgre and MyGUI been ported to 2.0? I know there are ports for 2.1. I use both in my project. I haven't been able to find any info on 2.0 in the forums. I am getting build errors due to the existing versions

I get errors similar to the following when I try to build both against 2.0:

Code: Select all

error: 'Sampler' in namespace 'Ogre' does not name a type
0 x

Post Reply