Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on Fedora 36 following buildsystem changes #78

Open
Calinou opened this issue Jul 25, 2022 · 7 comments
Open

Build error on Fedora 36 following buildsystem changes #78

Calinou opened this issue Jul 25, 2022 · 7 comments

Comments

@Calinou
Copy link
Contributor

Calinou commented Jul 25, 2022

OS: Fedora 36
Stunt Rally version: Git b029c7f

Building fails (see error at the end of CMake log):

❯ cmake -Bbuild                           
-- The CXX compiler identification is GNU 12.1.1
-- The C compiler identification is GNU 12.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib64/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Using conan: OFF
-- GCC detected, adding compile flags
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Boost: /usr/include (found version "1.76.0")  
-- Using 'Boost' system library (Found by find_package)
-- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- Checking for module 'OGRE'
--   Found OGRE, version 1.9.0
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib64/libOgreMain.so;debug;/usr/lib64/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib64/libOgrePaging.so;debug;/usr/lib64/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib64/libOgreTerrain.so;debug;/usr/lib64/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib64/libOgreProperty.so;debug;/usr/lib64/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib64/libOgreRTShaderSystem.so;debug;/usr/lib64/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib64/libOgreVolume.so;debug;/usr/lib64/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib64/libOgreOverlay.so;debug;/usr/lib64/libOgreOverlay.so
-- Using 'OGRE' system library (Found by find_package)
-- Found Bullet: /usr/lib64/libBulletDynamics.so 
-- Adding Bullet::Bullet target
-- Using 'BULLET' system library (Found by find_package)
-- Checking for module 'sdl2 >= 2.0'
--   Found sdl2 , version 2.0.22
-- Using 'SDL2' system library (Found by pkg_config)
-- Added inteface SDL2::SDL2 /usr/include/SDL2 /usr/lib64/libSDL2.so
-- Found MyGUI: /usr/include/MYGUI 
-- Using 'MyGUI' system library (Found by find_package)
-- Checking for module 'ogg >= 1.2'
--   Found ogg , version 1.3.5
-- Using 'OGG' system library (Found by pkg_config)
-- Added inteface OGG::OGG  /usr/lib64/libogg.so
-- Checking for module 'vorbis >= 1.2, vorbisfile >= 1.2'
--   Found vorbis >= 1.2, vorbisfile , version 1.3.7;1.3.7
-- Using 'VorbisFile' system library (Found by pkg_config)
-- Added inteface VorbisFile::VorbisFile  /usr/lib64/libvorbis.so;/usr/lib64/libvorbisfile.so
-- Checking for module 'openal >= 1.18'
--   Found openal , version 1.21.1
-- Using 'OpenAL' system library (Found by pkg_config)
-- Added inteface OpenAL::OpenAL /usr/include/AL /usr/lib64/libopenal.so
-- Checking for module 'libenet >= 1.2'
--   Found libenet , version 1.3.17
-- Using 'ENet' system library (Found by pkg_config)
-- Added inteface ENet::ENet  /usr/lib64/libenet.so
-- Checking for module 'tinyxml >= 2.6'
--   Found tinyxml , version 2.6.2
-- Using 'tinyxml' system library (Found by pkg_config)
-- Added inteface tinyxml::tinyxml  /usr/lib64/libtinyxml.so
-- Checking for module 'tinyxml2 >= 6'
--   Found tinyxml2 , version 7.0.1
-- Using 'tinyxml2' system library (Found by pkg_config)
-- Added inteface tinyxml2::tinyxml2  /usr/lib64/libtinyxml2.so
-- Found Boost: /usr/include (found version "1.76.0") found components: system thread filesystem wave chrono date_time atomic serialization 
-- Adding Boost::Boost target
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib64/libOgrePaging.so;debug;/usr/lib64/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib64/libOgreTerrain.so;debug;/usr/lib64/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib64/libOgreProperty.so;debug;/usr/lib64/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib64/libOgreRTShaderSystem.so;debug;/usr/lib64/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib64/libOgreVolume.so;debug;/usr/lib64/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib64/libOgreOverlay.so;debug;/usr/lib64/libOgreOverlay.so
-- Adding OGRE::OGRE target
CMake Error at cmake/dependencies-helpers/OGRE.cmake:11 (set_target_properties):
  Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.
Call Stack (most recent call first):
  cmake/DependenciesFunctions.cmake:294 (include)
  CMakeLists.txt:92 (resolve_conan_dependencies)


-- Configuring incomplete, errors occurred!

Note that I'm not using Conan here, I'm installing libraries from the Fedora 36 repositories (which should be up-to-date enough).

@cryham
Copy link
Member

cryham commented Jul 26, 2022

Well since this #76
didn't work for me (I build same way just on Debian 11 with Ogre 1.9 from repos)
I'd recommend this fix in /cmake/DependenciesConfig.cmake

        #  uncomment below for Ogre 1.9
        #PKG_CONFIG "OGRE, OGRE-Terrain, OGRE-Paging, OGRE-Overlay"        
        FIND_PACKAGE_OPTIONS CONFIG COMPONENTS Bites Overlay Paging RTShaderSystem MeshLodGenerator Terrain

works for me.

@Calinou
Copy link
Contributor Author

Calinou commented Jul 26, 2022

The CMake generationp step works with that PKG_CONFIG line uncommented, thanks 🙂

However, I get an error during building:

❯ cmake --build build -j1       
[2/7] Building CXX object source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o
FAILED: source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o 
/usr/lib64/ccache/c++ -DBOOST_ALL_NO_LIB -DOGRE_PLUGIN_DIR_DBG=\"\" -DOGRE_PLUGIN_DIR_REL=\"\" -DSHARED_DATA_DIR=\"share/games/stuntrally\" -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/btOgre -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/ogre -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/ogre/common -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/paged-geom -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/road -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/sound -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/vdrift -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/OGRE/Overlay -isystem /usr/include/bullet -isystem /usr/include/SDL2 -isystem /usr/include/MYGUI -isystem /usr/include/AL -fPIC -O3 -DNDEBUG -MD -MT source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o -MF source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o.d -o source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o -c /home/hugo/Documents/Git/stuntrally/stuntrally/source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp
/home/hugo/Documents/Git/stuntrally/stuntrally/source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp:14:12: error: redefinition of ‘struct Ogre::MaterialScriptContext’
   14 |     struct MaterialScriptContext
      |            ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/OGRE/OgreMaterialManager.h:37,
                 from /usr/include/OGRE/Ogre.h:68,
                 from /home/hugo/Documents/Git/stuntrally/stuntrally/source/ogre/pch.h:44,
                 from /home/hugo/Documents/Git/stuntrally/stuntrally/source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp:1:
/usr/include/OGRE/OgreMaterialSerializer.h:75:12: note: previous definition of ‘struct Ogre::MaterialScriptContext’
   75 |     struct MaterialScriptContext
      |            ^~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

@cryham
Copy link
Member

cryham commented Jul 26, 2022

Okay, I got the same issue.
Check my last commit for fix location. Basically needs to comment out this struct.
I wonder if I should just fix this, or will it break Ogre 1.13 or such.

@Calinou
Copy link
Contributor Author

Calinou commented Jul 26, 2022

Okay, I got the same issue.
Check my last commit for fix location. Basically needs to comment out this struct.
I wonder if I should just fix this, or will it break Ogre 1.13 or such.

With 73c4bbd and a fresh build folder, I'm getting an error here now:

❯ cmake --build build -j1
[1/5] Building CXX object source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o
FAILED: source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o 
/usr/lib64/ccache/c++ -DBOOST_ALL_NO_LIB -DOGRE_PLUGIN_DIR_DBG=\"\" -DOGRE_PLUGIN_DIR_REL=\"\" -DSHARED_DATA_DIR=\"share/games/stuntrally\" -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/btOgre -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/ogre -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/ogre/common -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/paged-geom -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/road -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/sound -I/home/hugo/Documents/Git/stuntrally/stuntrally/source/vdrift -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/OGRE/Overlay -isystem /usr/include/bullet -isystem /usr/include/SDL2 -isystem /usr/include/MYGUI -isystem /usr/include/AL -fPIC -O3 -DNDEBUG -MD -MT source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o -MF source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o.d -o source/shiny/CMakeFiles/shiny.OgrePlatform.dir/Platforms/Ogre/OgreMaterialSerializer.cpp.o -c /home/hugo/Documents/Git/stuntrally/stuntrally/source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp
/home/hugo/Documents/Git/stuntrally/stuntrally/source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp:14:12: error: redefinition of ‘struct Ogre::MaterialScriptContext’
   14 |     struct MaterialScriptContext
      |            ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/OGRE/OgreMaterialManager.h:37,
                 from /usr/include/OGRE/Ogre.h:68,
                 from /home/hugo/Documents/Git/stuntrally/stuntrally/source/ogre/pch.h:44,
                 from /home/hugo/Documents/Git/stuntrally/stuntrally/source/shiny/Platforms/Ogre/OgreMaterialSerializer.cpp:1:
/usr/include/OGRE/OgreMaterialSerializer.h:75:12: note: previous definition of ‘struct Ogre::MaterialScriptContext’
   75 |     struct MaterialScriptContext
      |            ^~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

@cryham
Copy link
Member

cryham commented Jul 27, 2022

need to:
#if 0 // set to 0, if build errors, for Ogre 1.9
it wasn't a fix yet

@cryham
Copy link
Member

cryham commented Jul 29, 2022

This should automatically work now in OgreMaterialSerializer
But the line in CMake is manual for Ogre 1.9

@AnotherFoxGuy
Copy link
Contributor

Is this still an issue on the master branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants