Error compiling Audacity 2.1.3 since commit 61177a1.

Commit:

https://github.com/audacity/audacity/commit/61177a15ad95cf3f8d1e8eb37518764d8b980307

Doesn’t compile.Ubuntu 16.04 x64. WxWidgets 3.1.1

Error:

In file included from FileFormats.cpp:26:0:
FileFormats.h:119:24: fatal error: ../MemoryX.h: No such file or directory
compilation terminated.
Makefile:2435: recipe for target 'audacity-FileFormats.o' failed

Solved by ,in FileFormats.h:

-  #include "../MemoryX.h"
+  #include "MemoryX.h"

Then:

n file included from FileFormats.cpp:26:0:
FileFormats.h:120:38: fatal error: ../ondemand/ODTaskThread.h: No such file or directory
compilation terminated.
Makefile:2435: recipe for target 'audacity-FileFormats.o' failed

With ondemand/ODTaskThread.h either.

-   #include "../ondemand/ODTaskThread.h"
+   #include "ondemand/ODTaskThread.h"

Then error:

FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
Makefile:2435: recipe for target 'audacity-FileFormats.o' failed
make[2]: *** [audacity-FileFormats.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from blockfile/SilentBlockFile.cpp:13:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
In file included from blockfile/LegacyBlockFile.cpp:34:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
config.status: creating src/configunix.h
config.status: src/configunix.h is unchanged
Makefile:2575: recipe for target 'blockfile/audacity-SilentBlockFile.o' failed
make[2]: *** [blockfile/audacity-SilentBlockFile.o] Error 1
In file included from blockfile/LegacyAliasBlockFile.cpp:20:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
Makefile:2519: recipe for target 'blockfile/audacity-LegacyBlockFile.o' failed
make[2]: *** [blockfile/audacity-LegacyBlockFile.o] Error 1
Makefile:2505: recipe for target 'blockfile/audacity-LegacyAliasBlockFile.o' failed
make[2]: *** [blockfile/audacity-LegacyAliasBlockFile.o] Error 1
In file included from blockfile/PCMAliasBlockFile.cpp:21:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
In file included from blockfile/ODPCMAliasBlockFile.cpp:33:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
In file included from blockfile/SimpleBlockFile.cpp:69:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
Makefile:2589: recipe for target 'blockfile/audacity-SimpleBlockFile.o' failed
make[2]: *** [blockfile/audacity-SimpleBlockFile.o] Error 1
In file included from blockfile/ODDecodeBlockFile.cpp:30:0:
blockfile/../FileFormats.h:116:1: error: ‘OSType’ does not name a type
 OSType sf_header_mactype(int format);
 ^
Makefile:2533: recipe for target 'blockfile/audacity-ODDecodeBlockFile.o' failed
make[2]: *** [blockfile/audacity-ODDecodeBlockFile.o] Error 1

Previous commit no problem.

Ok now. Thanks.

Thanks for the report and confirming fixed. However please note we don’t officially support greater than wx3.0.2 yet.


Gale

Back to WxWidgets 3.0.2. Using the native wxWidgets of Ubuntu 16.04 x64.

Sorry but build fails again.

First i have to replace ‘isnan’ by ‘std::isnan’ in usr/include/wx-3.0/wx/math.h line 59.

-  #define wxFinite(x) isfinite(x)
+  #define wxFinite(x) std::isfinite(x)

I in the source of Audacity also.

diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp
index eb9e2cb..4a2a537 100644
--- a/src/effects/Contrast.cpp
+++ b/src/effects/Contrast.cpp
@@ -421,7 +421,7 @@ void ContrastDialog::results()
    // TODO: We check for absolute silence here, so should not need to check again later in ::results()
    if (mForegroundIsDefined) {
       mForegroundRMSText->SetName(_("Measured foreground level"));   // Read by screen-readers
-      if(isinf(- foregrounddB))
+      if(std::isinf(- foregrounddB))
          mForegroundRMSText->ChangeValue(wxString::Format(_("zero")));
       else
          mForegroundRMSText->ChangeValue(wxString::Format(_("%.1f dB"), foregrounddB));   // i18n-hint: short form of 'decibels'        
@@ -433,7 +433,7 @@ void ContrastDialog::results()
 
    if (mBackgroundIsDefined) {
       mBackgroundRMSText->SetName(_("Measured background level"));
-      if(isinf(- backgrounddB))
+      if(std::isinf(- backgrounddB))
          mBackgroundRMSText->ChangeValue(wxString::Format(_("zero")));
       else
          mBackgroundRMSText->ChangeValue(wxString::Format(_("%.1f dB"), backgrounddB));
diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp
index 32ff21a..5037cd8 100644
--- a/src/effects/lv2/LV2Effect.cpp
+++ b/src/effects/lv2/LV2Effect.cpp
@@ -562,13 +562,13 @@ bool LV2Effect::SetHost(EffectHostInterface *host)
       lilv_scale_points_free(points);
 
       // Collect the value and range info
-      ctrl.mHasLo = !isnan(minimumVals[i]);
-      ctrl.mHasHi = !isnan(maximumVals[i]);
+      ctrl.mHasLo = !std::isnan(minimumVals[i]);
+      ctrl.mHasHi = !std::isnan(maximumVals[i]);
       ctrl.mMin = ctrl.mHasLo ? minimumVals[i] : 0.0;
       ctrl.mMax = ctrl.mHasHi ? maximumVals[i] : 1.0;
       ctrl.mLo = ctrl.mMin;
       ctrl.mHi = ctrl.mMax;
-      ctrl.mDef = !isnan(defaultValues[i]) ?
+      ctrl.mDef = !std::isnan(defaultValues[i]) ?
                   defaultValues[i] :
                      ctrl.mHasLo ?
                      ctrl.mLo :
diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp
index 91a0560..c4001cf 100644
--- a/src/effects/nyquist/Nyquist.cpp
+++ b/src/effects/nyquist/Nyquist.cpp
@@ -683,7 +683,7 @@ bool NyquistEffect::Process()
                // with very small values, bandwidth calculation may be inf.
                // (Observed on Linux)
                double bw = log(mF1 / mF0) / log(2.0);
-               if (!isinf(bw)) {
+               if (!std::isinf(bw)) {
                   bandwidth.Printf(wxT("(float %s)"), Internat::ToString(bw).c_str());
                }
             }

 
diff --git a/src/widgets/numformatter.cpp b/src/widgets/numformatter.cpp
index dfbf191..87c2412 100644
--- a/src/widgets/numformatter.cpp
+++ b/src/widgets/numformatter.cpp
@@ -134,11 +134,11 @@ wxString NumberFormatter::ToString(double val, int precision, int style)
         format.Printf(wxT("%%.%df"), precision);
     }
 
-    if (isnan(val))
+    if (std::isnan(val))
     {
         return _("NaN");
     }
-    if (isinf(val))
+    if (std::isinf(val))
     {
         return _("-Infinity");
     }

The last succesfull build is commit:

https://github.com/audacity/audacity/commit/54ac17c086f85184790ad2597cdf5b449c618f5c

So far so good,

But with next commit:

https://github.com/audacity/audacity/commit/1722ee9e323ebb44f193bc1b2cd81599a0d50ba2

Gives this error at the very end of the build:

audacity-VSTControlGTK.o -pthread  /usr/lib/x86_64-linux-gnu/libexpat.so ../lib-src/FileDialog/.libs/libFileDialog.a -lportaudio -lm ../lib-src/portmixer/src/.libs/libportmixer.a -lsndfile -lsoxr ../lib-src/lib-widget-extra/.libs/libwidgetextra.a -L/usr/lib/x86_64-linux-gnu -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -lFLAC++ -lFLAC /usr/lib/libid3tag.so -lz -lmad ../lib-src/libnyquist/libnyquist.a -lSoundTouch -ltwolame /usr/lib/x86_64-linux-gnu/libvorbisenc.so /usr/lib/x86_64-linux-gnu/libvorbisfile.so /usr/lib/x86_64-linux-gnu/libvorbis.so -logg -llilv-0 -lsratom-0 -lsord-0 -lserd-0 -lsuil-0 -lportSMF ../lib-src/sbsms/src/.libs/libsbsms.a -lvamp-hostsdk -ldl -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig /usr/lib/x86_64-linux-gnu/libfreetype.so -lasound -ljack -lpthread -lrt -pthread
audacity-Project.o: In function `std::__make_unique_result<PlayIndicatorOverlay>::scalar_case std::make_unique<PlayIndicatorOverlay, AudacityProject*>(AudacityProject*&&)':
/home/hains/audacity/src/commands/../MemoryX.h:395: undefined reference to `PlayIndicatorOverlay::PlayIndicatorOverlay(AudacityProject*)'
audacity-Project.o: In function `std::__make_unique_result<EditCursorOverlay>::scalar_case std::make_unique<EditCursorOverlay, AudacityProject*>(AudacityProject*&&)':
/home/hains/audacity/src/commands/../MemoryX.h:395: undefined reference to `EditCursorOverlay::EditCursorOverlay(AudacityProject*)'
audacity-Project.o: In function `std::__make_unique_result<ScrubbingOverlay>::scalar_case std::make_unique<ScrubbingOverlay, AudacityProject*>(AudacityProject*&&)':
/home/hains/audacity/src/commands/../MemoryX.h:395: undefined reference to `ScrubbingOverlay::ScrubbingOverlay(AudacityProject*)'
audacity-TrackPanel.o: In function `TrackPanel::DrawOverlays(bool)':
/home/hains/audacity/src/TrackPanel.cpp:7669: undefined reference to `TrackPanelOverlay::GetRectangle(wxSize)'
collect2: error: ld returned 1 exit status
Makefile:1951: recipe for target 'audacity' failed
make[2]: *** [audacity] Error 1
make[2]: Leaving directory '/home/hains/audacity/src'
Makefile:1346: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/hains/audacity/src'
Makefile:793: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

To figure out what the problem is, i remove as test the smart pointers and rename GetRectangle(size)) to DoGetRectangle(size))

diff --git a/src/Project.cpp b/src/Project.cpp
index fab8eec..e76a486 100644
--- a/src/Project.cpp
+++ b/src/Project.cpp
@@ -928,15 +928,12 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
                                              this,
                                              mRuler);
 
-   mIndicatorOverlay = std::make_unique<PlayIndicatorOverlay>(this);
-
-   mCursorOverlay = std::make_unique<EditCursorOverlay>(this);
-
+   
 #ifdef EXPERIMENTAL_SCRUBBING_BASIC
    // This must follow construction of *mIndicatorOverlay, because it must
    // attach its timer event handler later (so that its handler is invoked
    // earlier)
-   mScrubOverlay = std::make_unique<ScrubbingOverlay>(this);
+  
 #else
    mScrubOverlay = NULL;
 #endif
diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp
index d56a6f4..873c9ab 100644
--- a/src/TrackPanel.cpp
+++ b/src/TrackPanel.cpp
@@ -7666,7 +7666,7 @@ void TrackPanel::DrawOverlays(bool repaint)
    // Find out the rectangles and outdatedness for each overlay
    wxSize size(mBackingDC.GetSize());
    for (const auto pOverlay : mOverlays)
-      pairs.push_back(pOverlay->GetRectangle(size));
+      pairs.push_back(pOverlay->DoGetRectangle(size));
 
    // See what requires redrawing.  If repainting, all.
    // If not, then whatever is outdated, and whatever will be damaged by

Now build succesfull but Audacity does not execute of course (core dump).

Build with GIT master HEAD is only getting worser.

If for some reason you want to compile Audacity unstable code, you must accept that it will break from time to time while improvements are made. You also accept that you should not use these builds for production work.

You can check at https://travis-ci.org/audacity/audacity/builds to see whether Audacity is building on Linux at any particular commit.


Gale

Yes i know.

Anyway…Audacity is building fine now with Ubuntu 16.04 x64. Although i still need to apply my patches from my previous post.
(Except the last one(project.cpp)

Just for report.

Aha. I recently tried building Audacity on Ubuntu 16.04 x64 and had that “isnan” issue.

But I suspect we may need a more general fix so Audacity works better with gcc 5.

Thanks


Gale