如何在C ++和gtk下将相对路径转换为绝对路径?
答案 0 :(得分:1)
// For C++ with Gnome Gtkmm3 libraries
#include <string>
#include <glibmm.h>
#include <giomm.h>
using namespace std;
string PathRel2Abs(string relpath) {
Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(relpath);
return file->get_path();
}