-
Notifications
You must be signed in to change notification settings - Fork 2.4k
HttpLib unable to compile using MSVC, when integrated with C++ 20 Modules #2087
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
Comments
Please provide a minimal example to reproduce on Compiler Explorer. |
GodBolt is having trouble compiling with MSVC/CMake: compiler-explorer/compiler-explorer#6742 MRE here https://godbolt.org/z/Pborbb5nd, tho not cmake is not configuring |
That's unfortunate. Sorry about that!
I don't have access to MSVC otherwise, but after taking another look at the error in your linked posts, I'm not confident there's anything we can do about it anyway. |
I looked at the relevant code in microsoft/STL: Specifically, If I had access to MSVC, I'd see what happens with that function in the global module fragment (and some code that uses it). |
If you are willing to tell your email or send me an email at [email protected], I'm more than willing to set up a free cloud Windows instance (with proper license linked with HyperV in certain regions) for you |
Awesome, that would certainly help! E-mail me at [email protected]. Not that latency is a huge concern, but since you mentioned regions, my preferred data center locations are Frankfurt, DE, or Amsterdam, NL. Thanks! |
Sure, this process will take up to 3 business days (I have to go through a reimbursement process :) ), and I will notify you directly through email once it is done. Thanks in advance for investigating this problem. |
Just checking if you received my mail. I received no response and no one else connected to the VM instance. If you haven't seen my email, please check the junk box :) |
Thanks for checking in; you did end up in the spam folder. I'll test my theory tomorrow. If that doesn't reveal anything, I'll see if I can think of something else next week. Maybe I can figure out how to run C-Reduce/C-Vise on Windows. |
Small update: My test code built without issues, so there's some odd interaction between modules, the STL, and httplib going on. I'm now building C-Vise, which should take some time (maybe 24h?) on a single CPU system. I'll keep you posted. |
Update: Found that MSVC cannot compile as well if OpenSSL is enabled, as it cannot find a function defined by macro. (I tried to comment out all
It seems that both issues could be related to a bug in MSVC, where the compiler fails to resolve definitions under certain circumstances. (For |
That makes things more complicated, of course. We can work around MSVC issues in Meanwhile, C-Vise is built, and when I find some spare time, I'll write a test case for the reduction. |
Update: I couldn't get C-Vise to run correctly on Windows, so I'm running C-Vise locally and delegating the compilation to the VM. I asked Grok to write a client/server for me to do that, which worked well. It's been running for about 20 minutes, and we're down from 8250 lines to 7228 lines of code while still triggering the compiler error. Let's see where this goes… |
Sorry for my long absence. Three weeks ago, I made some planned hardware upgrades and expected to be offline for a few days at most. Things didn't go well. Ultimately, C-Vise failed to reduce the code sufficiently in a reasonable time frame. I aborted the first attempt after 6 hours (had to power off for the upgrades) and noticed that the My manual attempts to reproduce the issue also weren't fruitful. Since there's an additional problem not related to @Rabbit0w0 Thanks for the VM! Sorry, it didn't help. 🤷♂ |
Thanks for your generous help and I'm sorry to hear that things weren't going well. My temporary fix is to refactor all module-based classes in my project back to traditional headers. Hope Microsoft will improve their support for modern C++ features soon. And for anyone who is experiencing the same issue: |
@Rabbit0w0, @falbrechtskirchinger thank you for all the investigations for this issue! I'll leave this issue as 'information', so that others can benefit from it. |
Internal compiler error:
Solution:
Hope this helps someone. |
StackOverflow: https://stackoverflow.com/questions/79478667/msvc-unable-to-compile-program-with-c20-module-feature
MS Dev Community: https://developercommunity.visualstudio.com/t/MSVC-confused-with-operators-when-using/10861598
I'm assuming that if this is a compiler bug or sth else related to MSVC's nature, but Clang did compile my work. Though it is likely that HttpLib has nothing to do with this, can you roll out a temporary patch for MSVC?
The text was updated successfully, but these errors were encountered: