GLIB/GIO - G_VOLUME_GET_CONNECTECED_DRIVES RETURESS NULLC++

Programme in C++. Entwicklerforum
Anonymous
 GLIB/GIO - G_VOLUME_GET_CONNECTECED_DRIVES RETURESS NULL

Post by Anonymous »

Auf meinem frisch installierten Ubuntu 22.04 habe ich versucht, ein wenig mit dem GIO -System für ein Projekt zu basteln, das ich starten möchte.

Code: Select all

int main(){
GVolumeMonitor* monitor = g_volume_monitor_get();
GList* drives = g_volume_monitor_get_connected_drives(monitor);
return 0;
}
Leider ist der Zeiger Zeiger null .

Code: Select all

$ gio mount -l

Ich werde alle derzeit montierten Laufwerke und Volumes sehen. Das möchte ich haben.

Code: Select all

/usr/bin/g++ -fdiagnostics-color=always -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -g /home/user/dev/start/main.cpp -o /home/user/dev/start/main -L/usr/lib -L/usr/lib/x86_64-linux-gnu -lgio-2.0 -lgobject-2.0 -lglib-2.0
< /code>
Ausführen < /p>
GMainLoop* mainLoop = g_main_loop_new(NULL, true);
GVolumeMonitor* monitor = g_volume_monitor_get();
GList* drives = g_volume_monitor_get_connected_drives(monitor);
Gibt mir immer noch einen Null für Laufwerke .

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post
  • GLIB/GIO - G_VOLUME_GET_CONNECTECED_DRIVES RETURESS NULL
    by Anonymous » » in Linux
    0 Replies
    44 Views
    Last post by Anonymous
  • Wie schreibe ich eine Parkettdatei in Databricks Volume?
    by Anonymous » » in Python
    0 Replies
    10 Views
    Last post by Anonymous
  • GIO.Settings Verhalten ändern sich mit der Umgebung
    by Anonymous » » in Python
    0 Replies
    40 Views
    Last post by Anonymous
  • Wie erstelle ich eine glib.
    by Anonymous » » in Python
    0 Replies
    11 Views
    Last post by Anonymous
  • Warum kann ich die GLIB :: Fehlerausnahme in glibmm-2.4 nicht erfassen?
    by Anonymous » » in C++
    0 Replies
    30 Views
    Last post by Anonymous