Building with MSVC, PowerShell. Errors

I managed to get past it by editing in a few extra lines to BarBeatTrack.cc. I’m at a new set of errors right now, see the comment ~2 minutes before yours.

Crossed 1300/1843 (70+%)

Wow! This is incredibly involved.

Sorry to chip in out of nowhere. I use a build system for ardour (which is cross compiled) for Windows.

What is the point of a MSVC build? Literally to just let it be built on Windows?

Sorry if this is a silly thing to ask.

Thanks,

Matt.

It’s mainly to attract Window developers, who usually prefer MSVC to other development platforms :

Crossed 1400/1843 yesterday, stuck at a-eq. I assume MSVC can’t handle “double complex”.

Now building gtk2_ardour files.
Some are giving the errors:

C:\dev\ardour\libs\pbd\pbd\string_convert.h(335,14): error C2838: 'STRING_TO_TEMPLATE_NOT_DEFINED_FOR_THIS_TYPE': illegal qualified name in member declaration
C:\dev\ardour\libs\pbd\pbd\string_convert.h(335,14): note: the template instantiation context (the oldest one first) is
C:\dev\ardour\gtk2_ardour\ui_config_vars.inc.h(171,1): note: see reference to class template instantiation 'PBD::ConfigVariable<Editing::NoteNameDisplay>' being compiled
C:\dev\ardour\libs\pbd\pbd\configuration_variable.h(76,15): note: while compiling class template member function 'void PBD::ConfigVariable<Editing::NoteNameDisplay>::set_from_string(const std::string &)'
C:\dev\ardour\libs\pbd\pbd\configuration_variable.h(77,11): note: see reference to function template instantiation 'T PBD::string_to<T>(const std::string &)' being compiled
        with
        [
            T=Editing::NoteNameDisplay
        ]
C:\dev\ardour\libs\pbd\pbd\string_convert.h(335,14): error C2065: 'STRING_TO_TEMPLATE_NOT_DEFINED_FOR_THIS_TYPE': undeclared identifier
C:\dev\ardour\libs\pbd\pbd\string_convert.h(335,59): error C2146: syntax error: missing ';' before identifier 'invalid_type'
C:\dev\ardour\libs\pbd\pbd\string_convert.h(335,59): error C2065: 'invalid_type': undeclared identifier
C:\dev\ardour\libs\pbd\pbd\string_convert.h(238,14): error C2838: 'TO_STRING_TEMPLATE_NOT_DEFINED_FOR_THIS_TYPE': illegal qualified name in member declaration
C:\dev\ardour\libs\pbd\pbd\string_convert.h(238,14): note: the template instantiation context (the oldest one first) is
C:\dev\ardour\libs\pbd\pbd\configuration_variable.h(62,14): note: while compiling class template member function 'std::string PBD::ConfigVariable<Editing::NoteNameDisplay>::get_as_string(void) const'
C:\dev\ardour\libs\pbd\pbd\configuration_variable.h(63,10): note: see reference to function template instantiation 'std::string PBD::to_string<T>(T)' being compiled
        with
        [
            T=Editing::NoteNameDisplay
        ]
C:\dev\ardour\libs\pbd\pbd\string_convert.h(238,14): error C2065: 'TO_STRING_TEMPLATE_NOT_DEFINED_FOR_THIS_TYPE': undeclared identifier
C:\dev\ardour\libs\pbd\pbd\string_convert.h(238,59): error C2146: syntax error: missing ';' before identifier 'invalid_type'
C:\dev\ardour\libs\pbd\pbd\string_convert.h(238,59): error C2065: 'invalid_type': undeclared identifier

Now I’m at some errors relating to route groups. I think this is probably hard to deal with, as it’s related to some of the recent commits, so I’ll focus on getting some file changes over to some github forks and make pull requests.

I’m afraid I can’t help you with plugins or control surfaces as I only tend to build a few of them - but regarding TO_STRING_TEMPLATE_NOT_DEFINED etc, I covered this quite early on, so just search this thread.

Regarding the last errors relating to TO_STRING_TEMPLATE_NOT_DEFINED, the fix was to add #include “editing_convert.h” to ui_config.h.

No worries, by the looks of things, I’ve dealt with all plugins and control surfaces. I’ll get around to making pull requests for them.

@John_E Do you have an immintrin.h header file? I have it in C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\include .

Strange… I couldn’t see why that’d fix it so I tried it anyway but it didn’t work for me :worried:

Wait, where are you getting the errors, in libs/ardour or gtk2_ardour?

Some examples are gtk2_ardour/actions.cc and gtk2_ardour/gain_meter.cc but I’m sure there’ll be others. Also, regarding immintrin.h it’s one of these .input files I mentioned in post #6 (i.e. one of the ones which needs to get coped to your overall include folder)

Mine is commented out here so yes - it’s probably using the one supplied by Visual Studio now.

But do you have it from installing MSVC, in a similar path to what I shared? I wasn’t referring to the ardour files, regarding that header.

Also: regarding the DECLARE_DEFAULT_COMPARISONS issue: I completely skipped the #ifdef COMPILER_MSVC block in abstract_ui.inc.cc. For some reason, I didn’t have issues with ptw32_handle_t.

By chance could you try compiling PBD with the following?
pthread_utils.cc:
Replace the DECLARE… with

#ifdef COMPILER_MSVC
LIBPBD_API bool operator<(const pthread_t& lhs, const pthread_t& rhs) { 
    return lhs.p < rhs.p || (lhs.p == rhs.p && lhs.x < rhs.x); 
}
LIBPBD_API bool operator==(const pthread_t& lhs, const pthread_t& rhs) { 
    return lhs.p == rhs.p && lhs.x == rhs.x; 
}
#define pthread_gethandle  pthread_getw32threadhandle_np
#endif

In pthread_utils.h, add

#ifdef COMPILER_MSVC
LIBPBD_API bool operator<(const pthread_t& lhs, const pthread_t& rhs);
LIBPBD_API bool operator==(const pthread_t& lhs, const pthread_t& rhs);
#endif

Yes, the MSVC version came at around VS2019 - so since then, my version (immintrin.h.input) wasn’t needed any more.

At this stage I’d very much prefer you to make your changes as I suggested in post #131 - that’ll prevent your changes from leaving me with unbuildable code. Once you’ve arrived at a working build, I can then try substituting changes and using yours where appropriate.

Alright, you’ll have to bear with me a bit longer, sorry…
Also I reached the getopt.h error:

opts.cc
C:\dev\ardour\gtk2_ardour\opts.cc(25,10): fatal error C1083: Cannot open include file: ‘getopt.h’: No such file or directory

But it turns out, vcpkg has getopt: getopt | vcpkg.link: Vcpkg Ports and Packages Explorer

Installed it, then I got the following message on the terminal for opts.cc:

opts.cc
Importing getopt library

Crossed 1500/1843 (~81%)
Had to change a lot of RouteGroup code in the files due to errors, but using a raw pointer instead of a shared pointer for RouteGroup hasn’t been approved yet, so my edits (relating to gtk2_ardour bear risk of being in vain.

Edit: It is supposed to be a shared pointer, so I have mixes of old and new files causing the errors. Gotta get up to date.

Crossed 1600/1843. Had to update some files in libs/ardour, libs/evoral, and libs/surfaces/osc (and gtk2_ardour itself)


Edit: Crossed 1700. (~92%)


Another edit: Crossed 1770.

1 Like

Reached 1841/1842.

I’m not a wscript user so maybe Paul or Robin can help here - but my guess would be that you’ve built without having VST3_SUPPORT defined. Great to see you’ve reached the end though!!