libossia icon indicating copy to clipboard operation
libossia copied to clipboard

Cannot build on Windows

Open monsieurgustav opened this issue 2 years ago • 7 comments

Hi all, I'd like to give ossia a try, but I'm stuck at the first step: build it on Windows.

I tried (with cmake) :

  • the 2.0 RC and the 1.2.9
  • using Visual Studio 2019, 2022 and clang The ossia common code (src/ossia/*) just does not build, with a different (non trivial) error depending on the above combination.

Can someone luckier than me share his build config on Windows?

monsieurgustav avatar Dec 14 '22 14:12 monsieurgustav

Hello! I just noticed that the windows CI seems to be broken with the latest CMake version (it worked a week ago -_-).

Did you try the build steps outlined in the CI scripts? Normally, those are the official sanctioned and tested way to build libossia.

https://github.com/ossia/libossia/blob/master/.github/workflows/libossia.yml#L77

jcelerier avatar Dec 14 '22 21:12 jcelerier

I just tried: I only managed to build ossia_cpp (not ossia itself) in 2.0RC1 and 1.2.9 with VS2022.

In RC2, there is (at least) a circular dependency in ossia::value, that uses itself via value_map_type. It gives that error 'std::pairstd::string,ossia::value::second' uses undefined class 'ossia::value'. In RC1 and 1.2.9, I tend to have a compiler internal error (I love it) unless I use OSSIA_PCH=0.

In RC1, I cannot build ossia (while ossia_cpp works) because of: ..\3rdparty\boost_1_78_0\boost/variant2/variant.hpp(2252): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'const ossia::expressions::expression_generic' (or there is no acceptable conversion)

Using VS2019, there is a specific error regarding std::format. ..\src\ossia/network/value/format_value.hpp(43): error C2668: 'std::format_to': ambiguous call to overloaded function (VS2019 is still widely used and consider the default compiler on Windows some industries)

monsieurgustav avatar Dec 15 '22 13:12 monsieurgustav

It would be nice to provide both debug and release precompiled binaries of ossia_cpp for Windows. Currently using the release version with a debug app crashes. (not surprisingly) which makes it cumbersome to work with.

It's not super easy to build ossia_cpp, so providing it out of the box would help a lot!

monsieurgustav avatar Dec 15 '22 13:12 monsieurgustav

I just tried: I only managed to build ossia_cpp (not ossia itself) in 2.0RC1 and 1.2.9 with VS2022.

if you build ossia_cpp you should already have the libossia library actually, ossia-cpp is just a "simple" wrapper on top of it but it depends on the core libossia library already being built (at least according to the CMake rules, I don't know how much MSVC allows to subvert those)

Currently using the release version with a debug app crashes.

yes, that's true of anything that uses the standard C++ library on win32

very honestly, MSVC is really a drag to support (in addition to producing slower code than clang) ; minor updates break the compiler all the time ; I reported many many bugs to it over the years: that

but now stopped because it just keeps breaking on valid code all the time ; supporting VS2019 would require maintaining almost two different designs sometimes while GCC and Clang work just fine.

will try to add the debug version to the CI but now we are hitting a CMake bug... https://gitlab.kitware.com/cmake/cmake/-/issues/19220#note_1290007 -_-

jcelerier avatar Dec 15 '22 17:12 jcelerier

I guess there's an MSVC minor version bug as this works fine on godbolt with the exact flags we use for building https://gcc.godbolt.org/z/r44veq9rK

jcelerier avatar Dec 15 '22 19:12 jcelerier

i'm at loss, even copying the ossia value.hpp code verbatim works here: https://gcc.godbolt.org/z/cqq857oYq

jcelerier avatar Dec 15 '22 19:12 jcelerier

https://developercommunity.visualstudio.com/t/MSVC-143431933:-vectorgt;-with-B-a-fo/10232137 can't do much better than that :|

jcelerier avatar Dec 15 '22 20:12 jcelerier