MTG / essentia

C++ library for audio and music analysis, description and synthesis, including Python bindings
http://essentia.upf.edu
GNU Affero General Public License v3.0
2.86k stars 534 forks source link

Windows compilation fails with RogueVector #1360

Open jamiebullock opened 1 year ago

jamiebullock commented 1 year ago

I'm trying to compile "natively" on Windows 64-bit.

Currently using:

python waf configure --lightweight= --fft=KISS --build-static --msvc_targets="x64"

The build fails with many instances of:

c:\git\essentia\latest\src\essentia\roguevector.h(97): error C2039: '_Mylast': is not a member of 'essentia::RogueVector<T>'

Anyone know how to get around this?

jamiebullock commented 1 year ago

OK, the reason for this is that RogueVector relies on internal implementation details of std::vector, and these have now changed in the latest Microsoft C++ Standard Library.

So rather than std::vector::_Mylast we now have (for example) std::vector::_Mypair._Myval2._Mylast where _Mypair is private.

I don't see any way around this besides rewriting RogueVector so that it no longer inherits std::vector (something that should arguably done anyway). It should use a non-owning data structure such as std::span.