DRS4 Forum
  DRS4 Discussion Forum  Not logged in ELOG logo
Entry  Wed Mar 5 21:54:13 2014, Hermann-Josef Mathes, Software drs-5.0.0 fails to compile (drsosc) drs-5.patch
    Reply  Thu Mar 6 11:12:44 2014, Stefan Ritt, Software drs-5.0.0 fails to compile (drsosc) 
Message ID: 332     Entry time: Wed Mar 5 21:54:13 2014     Reply to this: 333
Author: Hermann-Josef Mathes 
Subject: Software drs-5.0.0 fails to compile (drsosc) 

Hi,

the latest software drs-5.0.0.tar.gz fails to compile on my freshly installed SuSE 13.1 whereas the previous 4.0.1 is compiling out-of-the-box.

My system has the wxWidgets 2.8.12 which is probably together with gcc 4.8.1 the reason of the problem. I applied a number of corrections, mainly some sort of proper (?) typecasts, a patch file is attached.

Maybe you could consider to take them into account for the next patch release?

Thanks and best regards

Hermann-Josef

 

Attachment 1: drs-5.patch  2 kB  | Hide | Hide all
diff --git a/src/DOScreen.cpp b/src/DOScreen.cpp
index 0147c29..3f6b665 100644
--- a/src/DOScreen.cpp
+++ b/src/DOScreen.cpp
@@ -110,7 +110,7 @@ void DOScreen::OnPaint(wxPaintEvent& event)
    
    // Change "Save" button
    if (!m_frame->GetWFfd() && !m_frame->GetWFFile())
-      m_frame->SetSaveBtn("Save", "Save waveforms");
+      m_frame->SetSaveBtn(wxT("Save"), wxT("Save waveforms"));
 }
 
 /*------------------------------------------------------------------*/
@@ -347,7 +347,7 @@ void DOScreen::DrawScopeBottom(wxDC& dc, int board, int x1, int y1, int width, b
    }
    x_start = x_start - 15 - w;
    if (m_frame->GetNSaved()) {
-      wxst.Printf("%d saved", m_frame->GetNSaved());
+      wxst.Printf(wxT("%d saved"), m_frame->GetNSaved());
       dc.GetTextExtent(wxst, &w, &h);
       dc.DrawRoundedRectangle(x_start-20-w, y1+3, w+10, 15, 2);
       dc.DrawText(wxst, x_start-15-w, y1+3);
diff --git a/src/TriggerDialog.cpp b/src/TriggerDialog.cpp
index 7aeb33e..32b41fa 100644
--- a/src/TriggerDialog.cpp
+++ b/src/TriggerDialog.cpp
@@ -26,13 +26,13 @@ TriggerDialog_fb( parent )
    m_cbANDEXT->SetValue((tc & (1<<12))>0);
    
    wxString s;
-   s.Printf("%1.3lf", m_frame->GetTrgLevel(0));
+   s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(0));
    m_tbLevel1->SetValue(s);
-   s.Printf("%1.3lf", m_frame->GetTrgLevel(1));
+   s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(1));
    m_tbLevel2->SetValue(s);
-   s.Printf("%1.3lf", m_frame->GetTrgLevel(2));
+   s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(2));
    m_tbLevel3->SetValue(s);
-   s.Printf("%1.3lf", m_frame->GetTrgLevel(3));
+   s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(3));
    m_tbLevel4->SetValue(s);
 }
 
@@ -49,19 +49,19 @@ void TriggerDialog::OnButton( wxCommandEvent& event )
 void TriggerDialog::OnTriggerLevel( wxCommandEvent& event )
 {
    if (event.GetId() == ID_LEVEL1)
-      m_frame->SetTrgLevel(0, atof(m_tbLevel1->GetValue()));
+      m_frame->SetTrgLevel(0, atof(m_tbLevel1->GetValue().mb_str()));
    if (event.GetId() == ID_LEVEL2)
-      m_frame->SetTrgLevel(1, atof(m_tbLevel2->GetValue()));
+      m_frame->SetTrgLevel(1, atof(m_tbLevel2->GetValue().mb_str()));
    if (event.GetId() == ID_LEVEL3)
-      m_frame->SetTrgLevel(2, atof(m_tbLevel3->GetValue()));
+      m_frame->SetTrgLevel(2, atof(m_tbLevel3->GetValue().mb_str()));
    if (event.GetId() == ID_LEVEL4)
-      m_frame->SetTrgLevel(3, atof(m_tbLevel4->GetValue()));
+      m_frame->SetTrgLevel(3, atof(m_tbLevel4->GetValue().mb_str()));
 }
 
 void TriggerDialog::SetTriggerLevel(double level)
 {
    wxString s;
-   s.Printf("%1.3lf", level);
+   s.Printf(wxT("%1.3lf"), level);
    m_tbLevel1->SetValue(s);
    m_tbLevel2->SetValue(s);
    m_tbLevel3->SetValue(s);
ELOG V3.1.5-fe60aaf