diff --git a/src/rviz/mesh_loader.cpp b/src/rviz/mesh_loader.cpp index 80f1120a77..950ffaf2aa 100644 --- a/src/rviz/mesh_loader.cpp +++ b/src/rviz/mesh_loader.cpp @@ -408,7 +408,7 @@ void loadTexture(const std::string& resource_path) { Ogre::DataStreamPtr stream(new Ogre::MemoryDataStream(res.data.get(), res.size)); Ogre::Image image; - std::string extension = fs::extension(fs::path(resource_path)); + std::string extension = fs::path(resource_path).extension().string(); if (extension[0] == '.') { diff --git a/src/rviz/robot/robot_link.cpp b/src/rviz/robot/robot_link.cpp index 7ffe26e1dc..c122ba9840 100644 --- a/src/rviz/robot/robot_link.cpp +++ b/src/rviz/robot/robot_link.cpp @@ -518,7 +518,7 @@ Ogre::MaterialPtr RobotLink::getMaterialForLink(const urdf::LinkConstSharedPtr& { Ogre::DataStreamPtr stream(new Ogre::MemoryDataStream(res.data.get(), res.size)); Ogre::Image image; - std::string extension = fs::extension(fs::path(filename)); + std::string extension = fs::path(filename).extension().string(); if (extension[0] == '.') {