anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
1.9k stars 182 forks source link

error: use of undeclared identifier '__gcd'; note that Makefile uses c++11 (and not c++17) #36

Closed GwynethLlewelyn closed 4 years ago

GwynethLlewelyn commented 4 years ago

Hello,

First of all, thanks so much for your port of untrunc, having a 'real' Makefile makes all the difference! 😄 I'm compiling under macOS Catalina 10.15.1 (Beta), using XCode 11.1, as well as brewto install libav, and I'm getting the error listed on the subject. According to this, there are two issues that require fixing:

  1. Do not use __gcd() — while it's common usage, it's supposed to be a private, internal function. Use gcd() instead.
  2. gcd() is available under c++17, but your Makefile uses c++11.

Both fixes are actually very easy to do (even for someone who has not programmed in C++ for almost two decades, like me! 😲)

Andz200zx commented 4 years ago

thanks for posting the solution to this, it meant I could get mine to work last night! there's a fork of this on my page that got it working fine on my Mojave machine using your suggestions if anyone needs it. also many thanks @anthwlock, this has saved some videos I was really struggling to recover!

anthwlock commented 4 years ago

thanks for reporting, fixed in 51ebdc1cf.