Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on Windows #817

Open
monsieurgustav opened this issue Dec 14, 2022 · 7 comments
Open

Cannot build on Windows #817

monsieurgustav opened this issue Dec 14, 2022 · 7 comments

Comments

@monsieurgustav
Copy link

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?

@jcelerier
Copy link
Member

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

@monsieurgustav
Copy link
Author

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
Copy link
Author

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!

@jcelerier
Copy link
Member

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
Copy link
Member

jcelerier commented Dec 15, 2022

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
Copy link
Member

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

@jcelerier
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants