How can i run in ubuntn18.04LTS?
chengYi-xun opened this issue · 4 comments
when I run replica_mono test and when I run to
std::shared_ptr<GaussianMapper> pGausMapper = std::make_shared<GaussianMapper>(pSLAM, gaussian_cfg_path, output_dir, 0, device_type);
here, an error occurs.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
How can I fix this error? i use the ubuntn18.04LTS build it successfully,but i can not run it
At the same time, when I run to here:
std::filesystem::path pathImageDir(strImageDir);
pathImageDir /= "results";
it also throws an error“段错误 (核心已转储)”. This seems to be an issue with std::filesystem::path
, and I don't know how to resolve it.
Hi!
It looks like the default version of gcc/g++ provided in Ubuntu 18.04 LTS does not support std::filesystem, which is formally implemented in C++17. I'm sorry that we have not tested with this OS before. Still, we find some solutions that might work for you. askubuntu.com says there might be two possible solutions:
- move from
<filesystem>
to<experimental/filesystem>
- install gcc-9 and g++-9, then create soft links to let cmake use them.
Thank you very much for your work. I have successfully run the code on Ubuntu 18.04. The error was resolved using the following method:
1.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-9 g++-9
and add to CMakeLists:
set(CMAKE_CXX_STANDARD_REQUIRED ON)
link_libraries(stdc++fs)