Building OgreNext 4.0.0 (unstable) - Windows 11, MinGW GCC 15.2 (Sucess BTW)

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Building OgreNext 4.0.0 (unstable) - Windows 11, MinGW GCC 15.2 (Sucess BTW)

Post by old_man_auz »

Hi,
I spent some time building OgreNext 4.0 unstable branch on Windows 11 using MinGW 15.2. MinGW was installed via MSYS2 (ucrt runtime).
I'm just writing this post as I had to work around a few issues and just wanted to put this info in a public space in case it is helpful to someone.

Building 'ogre-next-deps'
Building the 'ogre-next-deps' was a pain and in the end I only compiled AMD AGS package and installed the other libraries through MSYS2. There was something going on with compiling C files. I'll list some of the issues below. I don't expect these to be fixed as I believe dark_sylinc doesn't officially support MinGW, but I'm writing them in case they are of interest.

  1. FreeImage had 1000's (literally) of errors like:

    Code: Select all

    "C:/msys64/ucrt64/include/propidl.h:967:1: error: expected initializer before '<' token
      967 | __CRT_UUID_DECL(IEnumSTATPROPSETSTG, 0x0000013b, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46)
          | ^~~~~~~~~~~~~~~"
  2. Remotry had the following error:

    Code: Select all

    FAILED: [code=1] src/Remotery/CMakeFiles/Remotery.dir/src/Remotery.c.obj
    C:\msys64\ucrt64\bin\cc.exe -DRemotery_EXPORTS -DWINVER=0x0500  -O3 -DNDEBUG -MD -MT src/Remotery/CMakeFiles/Remotery.dir/src/Remotery.c.obj -MF src\Remotery\CMakeFiles\Remotery.dir\src\Remotery.c.obj.d -o src/Remotery/CMakeFiles/Remotery.dir/src/Remotery.c.obj -c C:/.../ogre-next-deps/src/Remotery/src/Remotery.c
    C:/.../ogre-next-deps/src/Remotery/src/Remotery.c:1171:22: error: conflicting types for 'rsize_t'; have 'unsigned int'
     1171 | typedef unsigned int rsize_t;
          |                      ^~~~~~~
    In file included from C:/msys64/ucrt64/include/crtdefs.h:10,
                     from C:/msys64/ucrt64/include/malloc.h:9,
                     from C:.../ogre-next-deps/src/Remotery/src/Remotery.c:96:
    C:/msys64/ucrt64/include/corecrt.h:52:16: note: previous declaration of 'rsize_t' with type 'rsize_t' {aka 'long long unsigned int'}
       52 | typedef size_t rsize_t;
  3. SDL2 had an issue in the install part of the build process where it was looking to copy "libSDL2.dll" but the build library name was "SDL2.dll" . Also I also had to manually edit a CMakeCache.txt and change "HIDAPI:BOOL=OFF".

  4. shaderc had a cmake(?) error:

    Code: Select all

    "ninja: error: build.ninja:305: bad $-escape (literal $ must be written as $$)"
  5. zziplib had many C errors. An example:

    Code: Select all

    FAILED: [code=1] src/zziplib/CMakeFiles/zziplib.dir/zzip/plugin.c.obj
    C:\msys64\ucrt64\bin\cc.exe -DWINVER=0x0500 -IC:/.../ogre-next-deps/src/zlib -IC:/.../ogre-next-deps/src/zziplib -O3 -DNDEBUG -MD -MT src/zziplib/CMakeFiles/zziplib.dir/zzip/plugin.c.obj -MF src\zziplib\CMakeFiles\zziplib.dir\zzip\plugin.c.obj.d -o src/zziplib/CMakeFiles/zziplib.dir/zzip/plugin.c.obj -c C:/.../ogre-next-deps/src/zziplib/zzip/plugin.c
    C:/.../ogre-next-deps/src/zziplib/zzip/plugin.c:49:5: error: initialization of 'zzip_ssize_t (*)(int,  const void *, zzip_size_t)' {aka 'int (*)(int,  const void *, long long unsigned int)'} from incompatible pointer type 'int (*)(int,  void *, unsigned int)' [-Wincompatible-pointer-types]
       49 |     &_zzip_read

Building OgreNext
Just to reiterate, I only built 'AMD AGS' from the 'ogre-next-deps' repo and the rest of the required dependencies I installed from MSYS2.

  1. There were lots of compiler warnings. A lot of them looked like there were to do with GCC 15.2 defaulting to c++ 17 (i think).
    Example:

    Code: Select all

     warning: implicitly-declared 'Ogre::Polygon& Ogre::Polygon::operator=(const Ogre::Polygon&)' is deprecated [-Wdeprecated-copy]
      121 |             *p = cpy.getPolygon( i );
  2. I couldn't get the DirectX11 render system to compile. The error was:

    Code: Select all

    C:/.../ogre-next/RenderSystems/Direct3D11/src/OgreD3D11Device.cpp:80:48: error: 'D3D11_RLDO_IGNORE_INTERNAL' was not declared in this scope
       80 |                                                D3D11_RLDO_IGNORE_INTERNAL );
  3. I was getting linking errors building the Vulkan render system, one example being:

    Code: Select all

    undefined reference to `glslang::TShader::TShader(EShLanguage)

    I fixed this in a dodgy way by editing "\ogre-next\RenderSystems\Vulkan\CMakeLists.txt" and modifying the line

    Code: Select all

    target_link_libraries(RenderSystem_Vulkan ${OGRE_NEXT}Main ${Vulkan_LIBRARIES})

    to

    Code: Select all

    target_link_libraries(RenderSystem_Vulkan ${OGRE_NEXT}Main ${Vulkan_LIBRARIES} glslang)
  4. At this point, the build process succeeded.

Running the Samples

  1. I started double clicking exe files from the samples directory. Nothing worked. Threw exception "OGRE EXCEPTION(1813:): The specified resource type cannot be found in the image file. in ConfigDialog::display". This ended up being caused in "ogre-next\OgreMain\src\WIN32\OgreConfigDialog.cpp" on line approx 300ish. Again, I did a dodgy fix a modified the code as per the following:

    Code: Select all

    if (mHInstance == NULL) {
            mHInstance = GetModuleHandle( "OgreNextMain.dll" ); // <--- MY EDIT, FORCE THIS
    }
    
    INT_PTR i = DialogBox( mHInstance, MAKEINTRESOURCE( IDD_DLG_CONFIG ), NULL, DlgProc );

mHInstance was NULL when being passed to 'DialogBox'

There was this code at the top of the file:

Code: Select all

#ifdef __MINGW32__
#    ifdef OGRE_STATIC_LIB
        mHInstance = GetModuleHandle( NULL );
#    else
#        if OGRE_DEBUG_MODE
        mHInstance = GetModuleHandle( "OgreMain_d.dll" );
#        else
        mHInstance = GetModuleHandle( "OgreMain.dll" );
#        endif
#    endif
#else

but I wasn't sure where to define MINGW32 and if that even was the correct thing to do. Once this change was made, rebuilt everything and the samples ran!!!!! Also is the "GetModuleHandle( "OgreMain.dll" )" the incorrect dll name for OgreNext builds?

  1. From memory, every sample ran (using Vulkan) except "screen space reflections" where the Ogre.log reported:

    Code: Select all

    23:19:29: WARNING: material SSR/ScreenSpaceReflectionsVectors has no supportable Techniques and will be blank. Explanation: 
    Pass 0: Fragment program SSR/ScreenSpaceReflectionsVectors_ps cannot be used - not supported.
  2. In the SDK release folder, there is a "resource.cfg" and a "resource2.cfg". Is "resource.cfg" a relic of Ogre v1?

Conclusion
The new atmosphere and particle samples look great. Thanks dark_sylinc and all the other Ogre team members and contributors. <3
Image

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 535
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Building OgreNext 4.0.0 (unstable) - Windows 11, MinGW GCC 15.2 (Sucess BTW)

Post by sercero »

Heroic effort :o

Lax
Gnoll
Posts: 685
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 65

Re: Building OgreNext 4.0.0 (unstable) - Windows 11, MinGW GCC 15.2 (Sucess BTW)

Post by Lax »

Hi old_man_auz,

I also tried to upgrade from OgreNewt3.0 to OgreNewt4.0, but had to give up, due to timing reasons.
Do you have a version for sharing?

I extended OgreNewt3_0 with nearly all features, that were possible, but wanted also go to OgreNewt4.0.

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Re: Building OgreNext 4.0.0 (unstable) - Windows 11, MinGW GCC 15.2 (Sucess BTW)

Post by old_man_auz »

Is OgreNewt the physics wrapper? I have never used it. From memory, it was originally for Ogre 1.0 right?

When you say OgreNewt3.0, do you mean you got it to compile against OgreNext 3.0?

And your looking to compile it against OgreNext 4.0??

Lax
Gnoll
Posts: 685
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 65

Re: Building OgreNext 4.0.0 (unstable) - Windows 11, MinGW GCC 15.2 (Sucess BTW)

Post by Lax »

Ah sorry for the confusion. I read: OgreNewt4.0 instead of OgreNext4.0 :oops:
I wanted to belive, that someone ported it, because I failed due to time and efford.
For you information: OgreNewt 3.0 was for newtondynamics physics engine 3.x. And now julio does develop newtondynamics4.x.
I adapted newtondynamics physics engine 3.x to OgreNext3.x and searching for newtondynamics physics engine 4.x to OgreNext3.x.

So this information is not relevant for this thread. Sorry.

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62