sigrokproject / pulseview

Read-only mirror of the official repo at git://sigrok.org/pulseview. Pull requests welcome. Please file bugreports at sigrok.org/bugzilla.
http://sigrok.org/wiki/PulseView
GNU General Public License v3.0
488 stars 156 forks source link

Compile from source problem with storesession.cpp " cannot convert ‘Glib::DateTime’ to ‘Glib::TimeVal’ " #70

Closed charkster closed 4 months ago

charkster commented 5 months ago

Hi am trying to compile Pulseview from source and am getting a compile error:

/home/xxxxx/pulseview/pv/storesession.cpp:188:96: error: cannot convert ‘Glib::DateTime’ to ‘Glib::TimeVal’
  188 |                 auto header = context->create_header_packet(session_.get_acquisition_start_time());
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                                                                |
      |                                                                                                Glib::DateTime

I looked more into this... https://docs.gtk.org/glib/method.DateTime.to_timeval.html

It says something about the conversion is not safe for 2038 dates. GTimeVal is not year-2038-safe. Use g_date_time_to_unix() instead.

Any ideas on how to get around this? I'm compiling the latest version on Ubuntu 24.04 using these instructions: https://sigrok.org/gitweb/?p=pulseview.git;a=blob;f=INSTALL Thanks.

thierer commented 4 months ago

You need to compile against a more recent libsigrok. start_time's type was changed in 2022.

charkster commented 4 months ago

You need to compile against a more recent libsigrok. start_time's type was changed in 2022.

@thierer thank you for the response. I guess I will have to compile libsigrok first as the Ubuntu version is so out-of-date.