[Solved] Error compiling OpenMW - stringrefid.cpp

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
guigui
Posts: 33
Joined: 12 Apr 2020, 12:22

[Solved] Error compiling OpenMW - stringrefid.cpp

Post by guigui »

Hi,

I'm with Debian 11. I installed (cmake + make + make install) the OpenSceneGraph fork for OpenMW ( https://github.com/OpenMW/osg ) (version 3.6.5 ). And the others dependencies for OpenMW.
Then i fetched the source, and buid:

Code: Select all

git clone https://gitlab.com/OpenMW/openmw

cd openmw
mkdir build
cd build
cmake ../

make
After 5% of building, during "Building CXX object components/CMakeFiles/components.dir/esm/stringrefid.cpp.o", i get:
/home/utilisateur/build/openmw/components/esm/stringrefid.cpp: In function ‘Misc::NotNullPtr<const std::__cxx11::basic_string<char> > ESM::{anonymous}::getOrInsertString(std::string_view)’:
/home/utilisateur/build/openmw/components/esm/stringrefid.cpp:24:38: error: no matching function for call to ‘std::unordered_set<std::__cxx11::basic_string<char>, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual>::find(std::string_view&)’
24 | auto it = locked->find(id);
| ^
In file included from /usr/include/c++/10/unordered_set:47,
from /home/utilisateur/build/openmw/components/esm/stringrefid.cpp:7:
/usr/include/c++/10/bits/unordered_set.h:649:7: note: candidate: ‘std::unordered_set<_Value, _Hash, _Pred, _Alloc>::iterator std::unordered_set<_Value, _Hash, _Pred, _Alloc>::find(const key_type&) [with _Value = std::__cxx11::basic_string<char>; _Hash = Misc::StringUtils::CiHash; _Pred = Misc::StringUtils::CiEqual; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::iterator = std::__detail::_Hashtable_base<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::__detail::_Identity, Misc::StringUtils::CiEqual, Misc::StringUtils::CiHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::iterator; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_type = std::__cxx11::basic_string<char>]’
649 | find(const key_type& __x)
| ^~~~
/usr/include/c++/10/bits/unordered_set.h:649:28: note: no known conversion for argument 1 from ‘std::string_view’ {aka ‘std::basic_string_view<char>’} to ‘const key_type&’ {aka ‘const std::__cxx11::basic_string<char>&’}
649 | find(const key_type& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/unordered_set.h:653:7: note: candidate: ‘std::unordered_set<_Value, _Hash, _Pred, _Alloc>::const_iterator std::unordered_set<_Value, _Hash, _Pred, _Alloc>::find(const key_type&) const [with _Value = std::__cxx11::basic_string<char>; _Hash = Misc::StringUtils::CiHash; _Pred = Misc::StringUtils::CiEqual; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::const_iterator = std::__detail::_Hashtable_base<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::__detail::_Identity, Misc::StringUtils::CiEqual, Misc::StringUtils::CiHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, true, true> >::const_iterator; std::unordered_set<_Value, _Hash, _Pred, _Alloc>::key_type = std::__cxx11::basic_string<char>]’
653 | find(const key_type& __x) const
| ^~~~
/usr/include/c++/10/bits/unordered_set.h:653:28: note: no known conversion for argument 1 from ‘std::string_view’ {aka ‘std::basic_string_view<char>’} to ‘const key_type&’ {aka ‘const std::__cxx11::basic_string<char>&’}
653 | find(const key_type& __x) const
| ~~~~~~~~~~~~~~~~^~~
make[2]: *** [components/CMakeFiles/components.dir/build.make:1330 : components/CMakeFiles/components.dir/esm/stringrefid.cpp.o] Erreur 1
make[1]: *** [CMakeFiles/Makefile2:1011 : components/CMakeFiles/components.dir/all] Erreur 2
make: *** [Makefile:149 : all] Erreur 2

How to resolve that?
Thanks in advance for your help.
Last edited by guigui on 11 Apr 2023, 17:24, edited 1 time in total.
guigui
Posts: 33
Joined: 12 Apr 2020, 12:22

Re: Error compiling OpenMW - stringrefid.cpp

Post by guigui »

Ok, i found the pb: it was gcc: i had gcc version 10.
Now i upgraded to gcc version 12. => it works.

Now i have another pb:
[ 70%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/engine.cpp.o
make[2]: *** No rule to make target « /lib/libMyGUIEngine.so », needed for « openmw ». Stop.

I'm going to dig that...
Edit: i just re-compile with the last nightly build and it works. 100%.
Post Reply