hzeller / txtempus

A DCF77, WWVB, JJY and MSF clock LF-band signal transmitter using the Raspberry Pi
GNU General Public License v3.0
441 stars 71 forks source link

does not compile in Visual Studio Cross env for RPI #18

Open lve0200 opened 3 years ago

lve0200 commented 3 years ago

Hi, I wanted to compile it in VS2019, but it doesn't. I works fine, when directly compiled on RPI 3B. VS creates an endless Error list for the system include stl_function.h complaining about "auto"

Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand Fehler (aktiv) E0040 Es wurde ein Bezeichner erwartet. DCF77 C:\Users\hk\AppData\Local\Microsoft\Linux\HeaderCache\1.0\-460273873\usr\include\c++\10\bits\stl_function.h 537 Fehler (aktiv) E1598 "auto" ist an dieser Stelle nicht zulässig. DCF77 C:\Users\hk\AppData\Local\Microsoft\Linux\HeaderCache\1.0\-460273873\usr\include\c++\10\bits\stl_function.h 537 Fehler (aktiv) E0065 Es wurde ein ";" erwartet. DCF77 C:\Users\hk\AppData\Local\Microsoft\Linux\HeaderCache\1.0\-460273873\usr\include\c++\10\bits\stl_function.h 538 Fehler (aktiv) E0840 In einer Deklaration einer primären Vorlage ist keine Vorlagenargumentliste zulässig. DCF77 C:\Users\hk\AppData\Local\Microsoft\Linux\HeaderCache\1.0\-460273873\usr\include\c++\10\bits\stl_function.h 556 ` private: template <typename _Tp, typename _Up> static constexpr decltype(auto) _S_cmp(_Tp&& t, _Up&& u, false_type) { return std::forward<_Tp>(t) > std::forward<_Up>(u); }

  template <typename _Tp, typename _Up>
static constexpr bool
_S_cmp(_Tp&& __t, _Up&& __u, true_type) noexcept
{
  return greater<const volatile void*>{}(
      static_cast<const volatile void*>(std::forward<_Tp>(__t)),
      static_cast<const volatile void*>(std::forward<_Up>(__u)));
}

  // True if there is no viable operator> member function.
  template<typename _Tp, typename _Up, typename = void>
struct __not_overloaded2 : true_type { };

  // False if we can call T.operator>(U)
  template<typename _Tp, typename _Up>
struct __not_overloaded2<_Tp, _Up, __void_t<
  decltype(std::declval<_Tp>().operator>(std::declval<_Up>()))>>`

It may have something to do w/ the following: https://stackoverflow.com/questions/40368535/unable-to-get-type-of-function-returning-constexpr-auto but this beyond my CPP knowledge. Could you make your code compatible? BR hk

hzeller commented 3 years ago

All the errors you show above are in the system headers not txtempus so you have to look through your installation first.

I don't quite understand why you want to go through the pain of using Windows with very poor support for a Unix environment to compile code for the Pi when it is just straightforward and simple to directly do it on the Pi. Even if you want to remote compile on Windows, I suggest to use llvm or gcc instead of msvc which has a lot of issues.