-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
MSVC: C2440 compiler error merging deps #126
Comments
I'm not very familiar with MSVC, but I heard recently from a client that Lager started building with MSVC when they enabled C++20 on a recent version. |
Tried building with C++20 (was building with C++17 and Intellisense shows the available overloads for |
I think you need MSVC 2021 for it to work. I still have a meeting pending with this client that made it work, I will report back when I get to know more about that. |
Hi @kevin--, I believe my pull request #127 might help with this issue. With this pull request, I could build and run all examples were I have all dependencies (i.e., nothing using Also, I can build and run all test. However, one of the tests As @arximboldi mentioned, I am using the version of MSVC that ships with Visual Studio 2022. |
@carsten-grimm-at-ipolog thank you for doing great work! We have been building with C++20 and I wrote a workaround class to manage dependencies as a global 😿 . Hopefully I will get a chance to try your changes 🙏 |
I am also using MSVC 2022 and wanted to try lager, but it seems it does not build anymore. Is anyone still using MSVC and also interested in fixing this? |
What kind of issue are you expderiencing @menzels ? |
compiling the tests i get the following errors:
build log with these errors: |
I'll wait for one of the Windows developers to chim in :) |
@menzels I believe the build issues are something to do with how msvc handles
I'm using VS2022 v17.2.5 and I can successfully run the tests. This needs c++20 so would only work for msvc and breaks the minimum c++17 requirement for everything else. I'm hesitant to put this forward as a PR as it seems to be a msvc bug and I don't think it's a good idea to change code permanently for a possibly temporary issue. |
Thank you a lot @frgp42 ! I do not have a Windows machine at hand so I can't really explore this much further, but I'd welcome a PR from someone that knows what's going on there. I agree thought that having C++20 as requirement feels like too much, and I'd rather keep the library C++17 compatible on all platforms. |
@carsten-grimm-at-ipolog did some work on porting to Windows, do you know what's going on? |
I've seen some of the same issues on Visual Studio 2019 v16.10.3:
|
@timpatt I'd be happy to accept a PR with any of those fixes. |
Thanks a lot for debugging these MSVC issues. |
My pleasure! Thanks for such an amazing set of libraries! We're about to head into a long weekend here but will look at raising a PR mid-next week... |
just updating from Previously building successfully with VS2019 and VS2022 with C++20 enabled and not using deps. Did enable Is this the fix you are suggesting @timpatt (in
|
Bisecting indicates that the |
Hi all. Sorry for the (very) late reply. I've raised the (very small) PR that captures the changes that I made to fix the build - at least with my minimal test case. @kevin--, do you have a minimal repro that I could try and look at? I haven't been able to reproduce it myself... I'm no expert, but I could have a play around at least! |
In case anyone else is interested in a workaround which is resolving all the build issues for me in Visual Studio: install "C++ Clang tools for Windows" in the vs installer and then switch the Platform Toolset in the project properties to "LLVM (clang-cl)". So far I haven't encountered any downsides to this. As far as I understand, it's still building a native windows app, linked against the windows runtime libraries, but compiling with clang. |
Or, if you are staying in the msvc compiler realm, be sure that the All that said, I'm preferring clang because it just happily builds lager as-is with no source modifications. It also builds significantly faster than msvc in my experience. |
I'm now getting |
In deps.hpp, we see this method starting at line 399
building with MSVC 2019 16.11.3,
return deps_t{*this, std::move(other)};
causes the error messagewith this hint in the log
same code compiles and runs good on AppleClang.
I'm not very familiar with
boost::hana
so some tips to troubleshoot would be appreciated. It seems that perhapsdeps_t
is not ending up as the expected type?This error is encountered with any number of deps greater than 0
The text was updated successfully, but these errors were encountered: