Witam. Próbuję wgryźć się w libparted.
Znalazłem starą wersję gparted i mam taki kawałek:
void Win_GParted::Find_Devices()
{
for ( unsigned int t=0;t<devices.size() ; t++ )
delete devices[ t ] ;
devices.clear() ;
ped_device_probe_all ();
//construct a list of device objects
PedDevice *device = ped_device_get_next (NULL);
while ( device )
{
str_devices.push_back( device ->path ) ;
device = ped_device_get_next (device) ;
}
for ( unsigned int t=0;t<str_devices.size() ; t++ )
{
temp_device = new GParted::Device( str_devices[t] );
temp_device ->Get_Length() > 0 ? devices.push_back( temp_device ) : delete temp_device ;
}
str_devices.clear() ;
//fill optionmenu_devices
menu_devices.items() .clear() ;
for ( unsigned int i=0;i<devices.size();i++ )
{
hbox_temp = manage( new Gtk::HBox() );
//the image...
image_temp = manage( new Gtk::Image( "/usr/share/icons/gnome/24x24/devices/gnome-dev-harddisk.png" ) );
hbox_temp ->pack_start( *image_temp, Gtk::PACK_SHRINK );
//the label...
os << Sector_To_MB( devices[i] ->Get_Length() ) ;
label_temp = manage( new Gtk::Label( " " + devices[i] ->Get_Path() + "\t (" + os.str() + " MB)" ) ); os.str("") ;
label_temp ->set_alignment( Gtk::ALIGN_LEFT );
hbox_temp ->pack_start( *label_temp, Gtk::PACK_SHRINK );
item = manage( new Gtk::MenuItem( *hbox_temp ) ) ;
menu_devices .items().push_back( *item );
}
}
Próbuję napisać własną funkcję, która wygląda tak:
#include <parted/constraint.h>
#include <parted/device.h>
#include <parted/disk.h>
#include <parted/exception.h>
#include <parted/filesys.h>
#include <parted/natmath.h>
#include <parted/unit.h>
{
ped_device_probe_all ();
PedDevice *device;
device = ped_device_get_next(NULL);
}
Niestety zostaję zasypany tym:
(.text+0x5e): undefined reference to
ped_device_probe_all()' (.text+0x5e): undefined reference to
ped_device_get_next(_PedDevice const*)'
Kompiluję z -L/usr/lib/ -lparted