You are not logged in.

#1 2016-07-05 17:17:51

Megameneer
Member
Registered: 2013-11-05
Posts: 34

[Solved] Couldn't compile OGRE 1.8

Hello everybody,

I have tried to compile OGRE 1.8, but it failed. I went to the OGRE forum, and they told me that it depends on a non-default GCC setting. These are the lines generated on the terminal by makepkg;

    [ 42%] Building CXX object RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/atifs/src/ATI_FS_GLGpuProgram.cpp.o
    In file included from /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreNode.h:34:0,
    from /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreSceneNode.h:33,
    from /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreSceneManager.h:37,
    from /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreSceneManagerEnumerator.h:33,
    from /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreRoot.h:36,
    from /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ATI_FS_GLGpuProgram.cpp:31:
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreMatrix3.h: In member function ‘Ogre::Real* Ogre::Matrix3::operator[](size_t) const’:
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/OgreMain/include/OgreMatrix3.h:117:24: warning: cast from type ‘const Real* {aka const float*}’ to type ‘Ogre::Real* {aka float*}’ casts away qualifiers [-Wcast-qual]
    return (Real*)m[iRow];
    ^
    [ 42%] Building CXX object RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/atifs/src/Compiler2Pass.cpp.o
    [ 42%] Building CXX object RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/atifs/src/ps_1_4.cpp.o
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    };
    ^
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:689:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:751:1: error: narrowing conversion of ‘-35025’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    };
    ^
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:751:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:751:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:751:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:791:1: error: narrowing conversion of ‘-35025’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    };
    ^
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:791:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:791:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:791:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:791:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:791:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:823:1: error: narrowing conversion of ‘-35025’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    };
    ^
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:823:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:823:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:861:1: error: narrowing conversion of ‘-35025’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    };
    ^
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:861:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:861:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:861:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:1003:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    };
    ^
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:1003:1: error: narrowing conversion of ‘-35051’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:1003:1: error: narrowing conversion of ‘-35133’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    /tmp/yaourt-tmp-dennis/aur-ogre-1.8/src/ogre_src_v1-8-1/RenderSystems/GL/src/atifs/src/ps_1_4.cpp:1003:1: error: narrowing conversion of ‘-35133’ from ‘int’ to ‘uint {aka unsigned int}’ inside { } [-Wnarrowing]
    make[2]: *** [RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/build.make:279: RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/atifs/src/ps_1_4.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:159: RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/all] Error 2
    make: *** [Makefile:150: all] Error 2

.
What should I do in order to get it work?

Last edited by Megameneer (2016-07-06 11:32:38)

Offline

#2 2016-07-05 18:11:44

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Couldn't compile OGRE 1.8

Moving to AUR Issues...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-07-05 19:41:35

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [Solved] Couldn't compile OGRE 1.8

See the 'Narrowing conversions' section here https://gcc.gnu.org/gcc-6/porting_to.html

You could try to compile it with the option -std=gnu++98

Edit:
Adding CXXFLAGS+=' -std=gnu++98' to the build() function works for me.

build() {
  cd ${srcdir}/${_src_dir}

  # patching CMake script for Freetype
  patch -p1 -i ${startdir}/freetype.patch

  # get a clean build dir
  [[ -d build ]] && rm -rf build
  mkdir build && cd build

  CXXFLAGS+=' -std=gnu++98'

  # generate CMake Makefile
  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/opt/${_dir} \
    -DOGRE_INSTALL_PLUGINS_HEADERS=TRUE \
    -DOGRE_INSTALL_SAMPLES=TRUE \
    -DOGRE_INSTALL_DOCS=FALSE \
    -DOGRE_INSTALL_MEDIA=TRUE \
    -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE \
    -DCMAKE_BUILD_TYPE=Release # set =Debug for debugging version

  # compile
  make
}

Last edited by mis (2016-07-05 20:46:08)

Offline

#4 2016-07-06 11:29:12

Megameneer
Member
Registered: 2013-11-05
Posts: 34

Re: [Solved] Couldn't compile OGRE 1.8

It works now. Thanks for the response!

Offline

Board footer

Powered by FluxBB