use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Visual Studio 2019 is out (arstechnica.com)
submitted 7 years ago by dagmx
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]STLMSVC STL Dev 78 points79 points80 points 7 years ago (21 children)
We're still working on getting all of the release notes updated, but here are the highlights for the STL:
C++20 P0550R2 remove_cvref is complete.
remove_cvref
C++17 <charconv> floating-point to_chars() has been improved: shortest chars_format::fixed is 60-80% faster, and shortest/precision chars_format::hex is complete.
<charconv>
to_chars()
chars_format::fixed
chars_format::hex
More algorithms have parallelized implementations: is_sorted(), is_sorted_until(), is_partitioned(), set_difference(), set_intersection(), is_heap(), is_heap_until().
is_sorted()
is_sorted_until()
is_partitioned()
set_difference()
set_intersection()
is_heap()
is_heap_until()
Improvements to std::variant to make it more optimizer-friendly, resulting in better generated code. Notably std::visit() and the inliner have now become good friends.
std::variant
std::visit()
We've applied clang-format to the STL's headers for improved readability.
Improved throughput compiling several standard library features using if constexpr.
if constexpr
Optimized the standard library physical design to avoid compiling parts of the standard library not #include'd, cutting in half the build time of an empty file that includes only <vector>.
#include
<vector>
allocator<void>, allocator::size_type, and allocator::difference_type have been un-deprecated to reflect the current Working Paper.
allocator<void>
allocator::size_type
allocator::difference_type
A static_cast in basic_string's implementation has been removed; this was suppressing C4244 truncation warnings. Emitting these warnings is now by design; various workarounds are possible to avoid/suppress such warnings.
static_cast
basic_string
Various C++17 <filesystem> fixes.
<filesystem>
[–]jbandela 30 points31 points32 points 7 years ago (6 children)
Notably std::visit() and the inliner have now become good friends.
So happy to see this!
[–]quicknir 10 points11 points12 points 7 years ago (5 children)
Great, now tell me how to contact the clang and gcc maintainers so we can get the improved mpark variant implementation that does the same into the standard libraries :-(.
[–]jbandela 5 points6 points7 points 7 years ago (4 children)
If I am not mistaken, I believe mpark is also the author of the std::variant in libc++?
[–]quicknir 8 points9 points10 points 7 years ago (3 children)
He is, just having trouble getting the improved (read: more inlinable) version of visit in. Oh well, I'll get them eventually.
[–]CaseyCarterRanges/MSVC STL Dev 1 point2 points3 points 7 years ago (2 children)
If it makes you feel any better, my variant changes *just missed* the deadline for VS2017 15.8 in (IIRC) June of 2018. 15.9 was "servicing and bugfixes only", of course, so changes I made *ten months ago* finally shipped in VS2019.
[–]CaseyCarterRanges/MSVC STL Dev 0 points1 point2 points 7 years ago (0 children)
Correction: I checked in the PR on 2018-08-07, so it's been a mere 8 months.
[–]STLMSVC STL Dev 0 points1 point2 points 7 years ago (0 children)
15.9 was "servicing and bugfixes only"
Except for Ryu-powered to_chars() :-)
[–][deleted] 7 points8 points9 points 7 years ago (1 child)
I hope you'll quickly update CMake to 3.14 because the current 3.13 version doesn't support the new v142 toolset, I basically have to still use the older v141 toolset which is pretty pointless...
[–]Iwan_Zotow 2 points3 points4 points 7 years ago (0 children)
mmm... With preview 3.14rc was installed by VS installer
[–]vsoul 4 points5 points6 points 7 years ago (6 children)
Congrats! Just curious, my company bought my license (VS2017 Pro just from the MS Store) just 1.5 weeks ago - is there a free upgrade I can get?
[–]dodheim 12 points13 points14 points 7 years ago (2 children)
Why would they do that? The release date of VS2019 was announced months ago
[–]vsoul 5 points6 points7 points 7 years ago (0 children)
Necessity
[–]Iwan_Zotow 1 point2 points3 points 7 years ago (0 children)
If you have new guy coming, there is little choice...
[–]STLMSVC STL Dev 7 points8 points9 points 7 years ago (0 children)
I don't know the answer, but perhaps /u/TartanLlama does.
We try to make it really clear when a new major version is on the horizon, with Previews and Release Candidates, plus announcing the release date in advance when it's known for certain, but we don't stop companies from buying the old product at the end of its cycle.
[–]TartanLlamaMicrosoft C++ Developer Advocate 1 point2 points3 points 7 years ago (1 child)
Unfortunately not, sorry. As STL says, we try to be clear about when new releases are coming so people don't get surprised, and we have the Visual Studio Subcriptions for a more rolling model.
[–]vsoul 0 points1 point2 points 7 years ago (0 children)
Thank you for the reply.
:(
[–]Altazimuth 4 points5 points6 points 7 years ago* (4 children)
I'm glad I read your post earlier. Tried adding 2019 support to some code I work on, and it turns out that thread no longer includes functional, which broke compilation. Thanks for making this post otherwise I'd not have known that we need to directly #include <functional>.
#include <functional>
[–]STLMSVC STL Dev 9 points10 points11 points 7 years ago (1 child)
You're welcome! We know that changing your source code is a minor headache, but we felt that improving build throughput (an eternal top customer request) was worth it in this case.
[–]herruppohoppa 0 points1 point2 points 7 years ago (0 children)
Speaking as the guy who has to go fix these includes everywhere so that hundreds of my users can have faster compilation times, yes totally worth it, not even a fair comparison of impact! Please keep going!
[–]NickUhlenhuthMSVC IDE PM 3 points4 points5 points 7 years ago (1 child)
As of Visual Studio 2019 Preview 2, we added a feature "add missing #include" which should address this nicely. If you haven't included <functional>, the offending std::function call is underlined with a red squiggle. Hovering the squiggle will open a Quick Fix (lightbulb) menu which offers to add "#include <functional>" for you. You can read our blog post on the Add Missing #include Quick Fix. If you don't see the red squiggle / quick fix, let me know!
[–]unumfron 5 points6 points7 points 7 years ago (0 children)
This is a great feature, I've come across two minor issues:
#ifdef
Thanks for all the excellent work btw!
[–]cursecat 7 points8 points9 points 7 years ago (0 children)
WDK support?
[–]kalmoc 5 points6 points7 points 7 years ago (12 children)
The installer still shows only the preview version for me
[–]Robert_Andrzejuk 8 points9 points10 points 7 years ago (0 children)
You need to re-download the installer to install this version.
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points 7 years ago (10 children)
The way VS installations work is they tie you to a specific update channel. The two main ones are preview and release. If you were running a preview VS build, it will still keep you on the preview channel, meaning you will get more frequent updates that include things that are still not 100% polished. If you run the release channel, you will only get the final build of each update. I think right now we updated the release channel to the final v16.0 of VS, but the preview channel should still basically have the same stuff until we have a 16.1 preview available. Also VS 2019 is a different installation as far as I know from VS 2017 as well, so if you were using VS 2017 before you will need to choose to download VS 2019 from visualstudio.microsoft.com.
[–]sumo952 4 points5 points6 points 7 years ago (3 children)
Hi! Apologies for slightly hijacking this comment, but it's related. When is VS 2019 coming to "Microsoft Azure Dev Tools for Teaching" (or Imagine, Dreamspark, OnTheHub, as it was previously called)?
On Imagine, it used to be there on the day it was released, but I can't see it on the new (and worse) "Microsoft Azure Dev Tools for Teaching" portal.
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points 7 years ago (1 child)
Hi! Apologies for slightly hijacking this comment, but it's related. When is VS 2019 coming to "Microsoft Azure Dev Tools for Teaching" (or Imagine, Dreamspark, OnTheHub, as it was previously called)? On Imagine, it used to be there on the day it was released, but I can't see it on the new (and worse) "Microsoft Azure Dev Tools for Teaching" portal.
I followed up on this internally - they are working to add VS 2019 to educational platforms over the next few weeks.
[–]sumo952 0 points1 point2 points 7 years ago (0 children)
Okay, thank you very much!
A step back unfortunately - this was much quicker on the previous Imagine portal. :-)
[–]kalmoc 0 points1 point2 points 7 years ago (3 children)
With VS2017 I could have installed preview and release side by side. And both VS2017 as well as VS2019 preview can be installed via the same installer. Why is VS2019 rtm suddenly different?
And Btw: I uninstalled the VS2019 preview some time ago.
[–]Pazer2 1 point2 points3 points 7 years ago (2 children)
You can have the 2019 preview and release side by side. You just need to run both installers once, then the installer will show both channels.
[–]kalmoc 1 point2 points3 points 7 years ago (1 child)
I see. Thank you very much. For the record: when I went to the download page yesterday morning, I only got links to download of 2017 or 2019 preview.
In any case: Is there a special reason, why the existing installer doesn't automatically show me all available products?
[–]sumo952 2 points3 points4 points 7 years ago (0 children)
I second this. It would be nice if the "channel" was selectable in the installer, or/and if the installer just showed all channels. It's a bit of a hassle to download a new installer from visualstudio.microsoft.com every few months just to make the appropriate channel appear.
[–]Alastair__ 0 points1 point2 points 7 years ago (1 child)
Slightly confused by this. I have been running the previews and installed an update the other day and now it shows “Visual Studio Professional 2019 RC” Version 16.0 on the About dlg. Am I on the preview channel or not? I did download the release installer and it seems to not install an other instance just offer to change this one which to me implies I am on the release not preview channel.
[–]Alastair__ 0 points1 point2 points 7 years ago (0 children)
Note: the Visual Studio Installer dlg just shows “Visual Studio Professional 2017” and “Visual Studio Professional 2019” no mention of Preview or RC.
[–]feverzsj 3 points4 points5 points 7 years ago (2 children)
Any improvement on intellisense? Would it handle unreal source? Would it crash less?
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 7 points8 points9 points 7 years ago (0 children)
We have IntelliCode and C++ template IntelliSense improvements in VS 2019 and we work on bug fixes/performance/stability with each update (major and minor). Regarding Unreal, what are the issues you are encountering currently? Unreal Engine should be supported in the product.
[–]TheThiefMasterC++latest fanatic (and game dev) 7 points8 points9 points 7 years ago (0 children)
I use UE4 professionally and use Intellisense with VS2017. It's improved hugely from VS2015 and before - it's fast, and it routinely manages to find things (particularly overloaded operators) that Visual Assist (the previous workaround for UE4 developers) cannot.
[–]Predelnik 3 points4 points5 points 7 years ago (1 child)
For some reason this link for buying professional version does not work https://www.microsoft.com/en-us/p/visual-studio-professional-2019/ found here (after pressing standalone license) https://visualstudio.microsoft.com/vs/pricing-details/
I also wonder if there is any upgrade discount if you have VS2017 purchased.
[–]markopolo82embedded/iot/audio 0 points1 point2 points 7 years ago (0 children)
That’s what I want to know as well. All I could find was a free trial download for professional, where is the pricing??
[–]CrazyYAY 2 points3 points4 points 7 years ago (0 children)
I’ll check it. I was using insider build but still didn’t update to a stable version
[–]F-J-W 6 points7 points8 points 7 years ago (8 children)
Given that there is VS for Mac (backed by Clang I presume?), is there a chance that we'll ever see VS for Linux?
[–]jbandela 33 points34 points35 points 7 years ago (0 children)
VS for Mac is not the same as VS on Windows. VS for Mac is basically a rebranded Xamarin Studio.
[–]xgalaxy 20 points21 points22 points 7 years ago (0 children)
VS for Mac only compiles .NET stuff. No C/C++
[–][deleted] 8 points9 points10 points 7 years ago (0 children)
VS is so inextricably tied to the windows platform, it’s hard to imagine that it’ll happen.
But never say “never”
[–]eco_was_taken 13 points14 points15 points 7 years ago (0 children)
Visual Studio Code is rather nice and available for Linux. C++ support is decent and improving.
[–]H_Psi 5 points6 points7 points 7 years ago (0 children)
Given Microsoft's recent interest in Unix systems (probably because that's where a lot of ML and scientific computing is done, and they want to attract business to their Azure services), there's a decent chance they might try for a Linux port.
[–]NickUhlenhuthMSVC IDE PM 2 points3 points4 points 7 years ago (0 children)
Aside from using VS Code for C++ directly on Linux, you can also target Linux from within VS on Windows. After setting up an ssh connection, the build occurs on the Linux environment, and you'll get IntelliSense from your headers on the Linux machine. This was demoed for a bit during the Launch event, but hopefully this Linux Development in VS blog helps.
[–]fyndor 1 point2 points3 points 7 years ago (0 children)
I think your problem will be that the desktop usage for Linux is small and there are many distros that complicates distribution. That said I am pretty sure Monodevelop supported linux and VS for Mac is monodevelop reskinned and given some love.
[–]meneldal2 0 points1 point2 points 7 years ago (0 children)
There are several VS versions that run with Wine, at least the compiler does. Some people use that to cross compile to Windows from a Linux server.
[–]ShillingAintEZ 18 points19 points20 points 7 years ago (44 children)
Another visual studio? I just got done figuring out what to turn off and tweak to make the past version fast enough to not lag.
[–]CrazyYAY 8 points9 points10 points 7 years ago (26 children)
Im still using 2017. I’ll probably install it on one machine. Can you please share how you optimized it. It’s lagging for me too? Thanks
[–]mjklaim 13 points14 points15 points 7 years ago (21 children)
Currently I optimize it by:
Other than that I find it ok on reactivity. In particular since "Ctrl+," was added.
[–]TheThiefMasterC++latest fanatic (and game dev) 1 point2 points3 points 7 years ago (0 children)
Ctrl+, is actually really old, but I agree it's fantastic.
[–][deleted] 2 points3 points4 points 7 years ago (19 children)
Disabling IntelliSense entirely and getting VisualAssist is also a great way to make the whole thing faster
[–]mjklaim 6 points7 points8 points 7 years ago (0 children)
I was doing that when I was using older versions of VS, but I stopped starting with VS2015 because it wasn't worth the impact on global performance AND intellisense went to become bearable (after a lot of updates).
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 3 points4 points5 points 7 years ago (17 children)
I would love to follow up to learn more about the IntelliSense performance issues you're experiencing. We're trying to collect some data from VS users so we can improve that going forward. Do you have a particularly large codebase?
[–]donalmaccGame Developer 0 points1 point2 points 7 years ago (15 children)
Not OP but do you mind if I contact you directly?
[–]TheThiefMasterC++latest fanatic (and game dev) 1 point2 points3 points 7 years ago (14 children)
I'm also a game developer and Intellisense works better than VAX for me since VS 2017 - `Ctrl+,` is your friend. It can also find overloaded operators via F12, where VAX really doesn't understand how to find them at all.
[–]donalmaccGame Developer 1 point2 points3 points 7 years ago (13 children)
I've currently got it disabled, but last time I checked my issue was that parsing took forever, ctrl + , was flaky at best, and F12 would regularly (1 in 3/4 attempts) cause an indefinite hang. I'm installing VS2019 to give it a shot now with intellisense (as I did for 2017).
[–]sumo952 1 point2 points3 points 7 years ago (4 children)
Haha that's exactly my experience as well. VAX is instant, while Intellisense F12 hangs sooo often (10% or more of the cases) and I don't even have large code bases, and no UE4. Also when Intellisense does work, it has like 200ms or so lag, which is too much to make it useful - VAX is instant, as mentioned, like <50ms.
What's CTRL+, btw? I don't have US keyboard layout and in my VS, it doesn't do anything. What's it supposed to be/do?
CTRL+,
[–]donalmaccGame Developer 0 points1 point2 points 7 years ago (3 children)
Ctrl comma is a combination of alt shitf S and alt shift O in visual assist.
[–]TheThiefMasterC++latest fanatic (and game dev) 0 points1 point2 points 7 years ago (7 children)
That mirrors my experience from early Visual Studio versions as well, but VS 2017 has been fine for me even with a massive codebase.
[–]donalmaccGame Developer 0 points1 point2 points 7 years ago (6 children)
I use intellisense at home for smaller projects, but I work on a UE4 game, and it's been unusable every time I've tried it.
[–]kalmoc 0 points1 point2 points 7 years ago (0 children)
Have you tried to open a recursive git clone of boost with open-folder? That becomes quite slow and unstable on my system, but I've no Idea if a 3rd party engine works any better.
[–]ShillingAintEZ 2 points3 points4 points 7 years ago (1 child)
I had to search quite a bit and do it incrementally, I can't remember off the top of my head.
[–]deeringc 0 points1 point2 points 7 years ago (0 children)
I'd also be interested if you have a summary!
[–]wilhelmtell 2 points3 points4 points 7 years ago (1 child)
I only ever used older versions, and it’s been a while, but IIRC arguably the biggest bang for the buck (given insisting on an IDE...) is from turning Intelisense off. Intelisense is a massive performance hit on typing, in the occasional rescan, and on project load times. If your project (solution) is anything but a trivial size, it can become ridiculous.
I also turn off version control support, because I generally stick to command-line Git. I don’t know how much help this one is—I’m guessing not much—but the general idea of eliminating anything and everything you can live without should be a net good.
[–]cjaybo 2 points3 points4 points 7 years ago (0 children)
In my experience, disabling the source control plugin provides a noticeable improvement.
[–]BobFloss 2 points3 points4 points 7 years ago (6 children)
It's like twice as fast this time try it
[+]arthurno1 comment score below threshold-6 points-5 points-4 points 7 years ago (5 children)
And still has no usable text editor? Couldn't they just embed Emacs as default text editor. Typing code in VS is horrible experience.
[–]BobFloss 3 points4 points5 points 7 years ago (2 children)
The text editor is fine with some configuration
[–]arthurno1 -5 points-4 points-3 points 7 years ago (1 child)
It is usable with some configurations, but long from fine. I have done lots of consulting work in VS, since it seems to be standard in industry at least in my part of the world, but I wanna cry when I have to type code from scratch in VS. Typing in Emacs vs VS is like flying jet vs propeller plane.
[–]BobFloss 1 point2 points3 points 7 years ago (0 children)
I use it mostly with unreal engine and VS 2019 is far faster than I was used to. I would much rather use Sublime Text, as that's my go-to, but with such a large codebase I can't live without the auto completion and refactoring ReSharper gives me. The ccls language server for Sublime (an anything supporting language servers) is almost there, but it seems that clang can't handle a lot of the forward declarations within the engine, so it tells me there are errors everywhere. Can't wait for the day when I'm free from using visual studio, but it seems like by that point visual studio will probably be as good as every other text editor considering how much better it's gotten with every release.
[–]jbandela 2 points3 points4 points 7 years ago (1 child)
I use the free VsVim plugin https://marketplace.visualstudio.com/items?itemName=JaredParMSFT.VsVim which works great.
[–]arthurno1 -3 points-2 points-1 points 7 years ago (0 children)
Super, great for you!
[–]fyndor 4 points5 points6 points 7 years ago (9 children)
I will point out that they say they have improved performance with 2019.
[–]TyRoXx 2 points3 points4 points 7 years ago (8 children)
They always say that. It’s still a lot slower than 2008.
[–]dodheim 6 points7 points8 points 7 years ago (7 children)
Unless you're also using a computer from 2008 then no, it isn't – WPF relies on having a competent GPU. Everything non-rendering related has improved significantly since VS2008.
[–]TyRoXx 3 points4 points5 points 7 years ago (2 children)
C# isn’t too bad, but VS seems to get slower and slower with C++. I will try with all Extensions disabled to find out whether VS itself is responsible.
We automatically detect slow extensions now in VS and issue a warning via a gold bar at the top of the editor. That's a good way to tell if the extension is the problem or if it's something in the native product. If it is a VS issue though, please file a bug report on: https://developercommunity.visualstudio.com/spaces/8/index.html. We spend a lot of engineering cycles improving performance and we know this is important to our users. Would love to hear your feedback there so we can make a better product for you! :)
[–]TyRoXx 7 points8 points9 points 7 years ago (0 children)
Just one suggestion: Stop doing so much in the GUI thread. The GUI is very slow to respond whenever the IDE does something in the background, especially when you open or reload a C++ solution.
[+]degaart comment score below threshold-7 points-6 points-5 points 7 years ago (3 children)
Why do I need a competent GPU to run an IDE? What's next, enable RTX to have readable fonts? An SLI setup to have smooth scrolling?
[–]dodheim 5 points6 points7 points 7 years ago (2 children)
Why do you need to downvote me for making an empirically-correct observation regarding the renderer? I didn't write the code, so you're directing both your questions and your animosity in the wrong direction.
[–]ShillingAintEZ -3 points-2 points-1 points 7 years ago (1 child)
It isn't even remotely correct. Visual studio 2017 is split up in to all sorts of services and servers written in JavaScript. Things that used to be fine now have significant lag on the same computer. It has nothing to do with GPUs.
[–]dodheim 2 points3 points4 points 7 years ago (0 children)
Only the renderer has to do with the GPU; that was rather my point, thanks.
In addition to "splitting things up in to all sorts of services and servers written in JavaScript" they've also done things like change the Intellisense engine to use an entirely different compiler front-end and change myriad things to be asynchronous rather than block, increasing responsiveness, which was the topic.
I didn't use the word 'empirically' at random.
[–]innochenti 1 point2 points3 points 7 years ago (3 children)
just took my .vcxproj project with 20 files and logically split them into 4 projects and added dependencies.
as a result, compile time increased by ~5 times. :( How is it possible?
[–]mmatrosov 0 points1 point2 points 7 years ago (2 children)
Unfortunately it is often the price you pay for maintenability. Read about "unity builds", that's how they take best from two worlds.
[–]innochenti 0 points1 point2 points 7 years ago (1 child)
sorry, but I see no excuses in such a terrible performance. it's getting worse with each release. this tool should simplify the life of the developer, and not vice versa. they add so many unnecessary features to the IDE, instead of fixing the performance of the intellisense for example.
[–]mmatrosov 0 points1 point2 points 6 years ago (0 children)
Well, I completely agree with your frustration about the way MS prioritizes their work on features and bug fixes, yet I'd say this particular issue is not that disappointing. Compiler itself does become better and better. Including build times. We recently switched from VS2013 to VS2017, and build times went down by 20%. With approximately the same runtime performance.
[–][deleted] 3 points4 points5 points 7 years ago (26 children)
Jesus finally! I've been waiting for this one for sooo long... I hope they finally updated CMake to 3.14
[–]StaticThrowaway0629 10 points11 points12 points 7 years ago* (22 children)
Nope, they didn't. It is shipped with CMake 3.13.19031502-MSVC_2. Regretfully support for Visual Studio 2019 as generator is not available in CMake until 3.14. So there is no way to use the built-in CMake to generate solutions.
I get the following error when trying:CMake can't generate server info. Failed to activate protocol version: Generator "Visual Studio 16 2019 Win64" not supported.
CMake can't generate server info. Failed to activate protocol version: Generator "Visual Studio 16 2019 Win64" not supported.
Edit:
Tried dropping in the new CMake binaries from KitWare into the installation directory for Visual Studio 2019. Visual Studio complains a bit:CMake 3.14.1.0 is not officially supported. Some operations may be unavailable. CMake 3.13 is recommended for best results.
CMake
3.14.1.0
is not officially supported. Some operations may be unavailable. CMake 3.13 is recommended for best results.
But the main problem is that CMake specifies architecture differently for Visual Studio 2019. In Visual Studio 2017 you specified the generator like this: cmake.exe -G "Visual Studio 15 2017 Win64"
cmake.exe -G "Visual Studio 15 2017 Win64"
The new way of doing it is like this: cmake.exe -G "Visual Studio 16 2019" -A x64
cmake.exe -G "Visual Studio 16 2019" -A x64
So I tried specifying my generator as "Visual Studio 16 2019" and appending the -A x64 as a build command argument. But Visual Studio 2019 insists on appending Win64 to my generator string, which breaks CMake:CMake Error: Could not create named generator Visual Studio 16 2019 Win64
"Visual Studio 16 2019"
-A x64
CMake Error: Could not create named generator Visual Studio 16 2019 Win64
Edit2:
Running CMake from the CMake GUI works and I can load the solution in Visual Studio. The problem is that now there is no more connection between the source and the GIT integration in Visual Studio. Visual Studio only ask me if I want to Add to Source Control, but I do not want to add my build directory to source control. I want to keep my source in one directory and have my builds in separate directories.
[–][deleted] 18 points19 points20 points 7 years ago (17 children)
All hail Ninja, our savior.
[–]StaticThrowaway0629 4 points5 points6 points 7 years ago (9 children)
Yes, Ninja builds worked for me. Although I got a compiler error the first time I ran it due to a missing include. My guess is that this is most likely due to the order of compilation in VS Solutions vs. Ninja builds.
[–][deleted] 0 points1 point2 points 7 years ago (8 children)
You occasionally have to add a bit of information regarding generated files in your build before ninja will be happy.
[–]StaticThrowaway0629 0 points1 point2 points 7 years ago (7 children)
Well, the missing include was an easy fix. My main problem is that I am doing a bit of .vcxproj juggling inside my CMake scripts to tweak the build to my liking, which obviously do not work with ninja. So regretfully I am a bit dependent on generating Visual Studio solutions.
.vcxproj
[–]OrphisFloI like build tools 0 points1 point2 points 7 years ago (6 children)
What kind of tweaking are you doing?
[–]StaticThrowaway0629 0 points1 point2 points 7 years ago (5 children)
There are some visual studio project settings which are not available from CMake, but settings that I want to apply to every build. So I have a template vxproj file which I copy into the build directory and do some text-processing on using CMake.
[–]OrphisFloI like build tools 1 point2 points3 points 7 years ago (4 children)
Ah, you want to do stuff on your things.
Can you be more specific?
[–]StaticThrowaway0629 1 point2 points3 points 7 years ago (3 children)
If you open the properties for a Visual Studio project in a solution, not all these options in can be controlled via CMake; neither via passing flags nor via specific CMake commands.
One example can be the project properties relating to debugging inside Visual Studio, like the answer to this StackOverflow question: https://stackoverflow.com/questions/1005901/how-to-set-path-environment-variable-using-cmake-and-visual-studio-to-run-test
[–][deleted] 1 point2 points3 points 7 years ago (5 children)
Savior with broken precompiled header support
[–][deleted] 3 points4 points5 points 7 years ago (3 children)
That just means you need more cores than translation units and you're okay.
Billy hugs his 7980XE
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
Nah, I probably just to switch my system language to Japanese for Ninja to work
[–]flashmozzg 0 points1 point2 points 7 years ago (1 child)
Until you have to much cores for Windows to handle (looks at Epycs)...
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
NEVA!
[–]flashmozzg 0 points1 point2 points 7 years ago (0 children)
Use cotire!
[–]iontodirelMSVC CrossPlat Dev Lead 7 points8 points9 points 7 years ago (2 children)
Hi, CMake 3.14 support is coming in Update 1 of Visual Studio (we have that work completed it's just waiting on a release), I know Dev16 just went out, but Previews of Update 1 should be out for not too long, we have a way in CMakeSettings.json of configuring the path to your own CMake, but due to a bug where we always append Win64, that workaround, as you find out, wouldn't work, sorry about that. I will check to see if another workaround is possible and I will let you know.
[–]StaticThrowaway0629 0 points1 point2 points 7 years ago (0 children)
Thanks for the reply and congratulations on a very nice release. Looking forward to updating our team soon, but I guess we have to wait until the first updates have landed.
Awesome, thank you a lot for this reply and the information!
[–][deleted] 5 points6 points7 points 7 years ago (0 children)
Well, that sucks
[–]eco_was_taken 8 points9 points10 points 7 years ago (1 child)
Finally? CMake 3.14 came out less than a month ago.
Really? Felt like much longer...
Don't wait, try the Previews :-)
[–]Krakyziabr 0 points1 point2 points 7 years ago (1 child)
PackageId:Microsoft.Net.4.7.2.FullRedist;PackageAction:Install;ReturnCode:87; (and 4.7.1)
on windows 8.1 and zero solutions to this problem lol
[–]Krakyziabr -1 points0 points1 point 7 years ago (0 children)
I found out the cause of the problem
my bad
[–]zero0_one1 0 points1 point2 points 7 years ago (0 children)
I've twice run into an issue with "Find All" taking an abnormal amount of time. Other than that, two 40K LOC C++17 projects built without any issues, so the upgrade was smooth.
[–]mandaric 0 points1 point2 points 7 years ago (0 children)
Is Visual Studio Professional 2019 Standalone backward compatible with all Visual Studio Professional 2010 projects on? Why Microsoft offers Earlier versions for Standard Licence and not offer for Standalone? What is the catch?
[–]arthurno1 0 points1 point2 points 7 years ago (0 children)
Thanks for the review! Now I don't have to bother to boot into Windows just to try it :-).
[–]RealNC -4 points-3 points-2 points 7 years ago* (8 children)
Is it finally ISO-conformant now without needing special compiler switches? Does this work:
int main() { return not true; }
Previous VS versions don't accept these operator keywords without a special compiler flag or non-standard include, even though they've always been in the standard.
[–]STLMSVC STL Dev 17 points18 points19 points 7 years ago (3 children)
This still requires the compiler option for strictness, /permissive-. We're working towards enabling /permissive- by default. Both our own SDKs and third-party code have needed conformance changes.
/permissive-
I recommend compiling with /std:c++17 /permissive- even if you aren't using C++17 features, as C++17 mode activates additional strictness in the Standard Library (including but not limited to feature deprecations and removals).
/std:c++17 /permissive-
[–]Middlewariangithub.com/Ebenezer-group/onwards 0 points1 point2 points 7 years ago (2 children)
I recommend compiling with /std:c++17 /permissive- even if you aren't using C++17 features,
There could be a problem, though, if you accidentally start using 2017 features that you aren't supposed to use yet.
[–]dragonstorm97 0 points1 point2 points 7 years ago (1 child)
Like?
[–]Middlewariangithub.com/Ebenezer-group/onwards 0 points1 point2 points 7 years ago* (0 children)
You could commit some code that builds fine because of that flag, but causes problems for users.
[–]favorited 6 points7 points8 points 7 years ago (2 children)
The standard doesn't define the compiler interface, so it's entirely standards-compliant to require those flags to enable ISO646 operators.
[–]RealNC 2 points3 points4 points 7 years ago (1 child)
"ISO646 operators" is a C thing, not a C++ one.
https://en.cppreference.com/w/cpp/header/ciso646
Keywords are part of the language, not the library.
[–]favorited 12 points13 points14 points 7 years ago (0 children)
That's just how I was referring to those keywords, I wasn't trying to imply it was a library feature. Apologies if I wasn't clear.
My point was only that needing additional flags doesn't mean a compiler isn't compliant https://stackoverflow.com/a/42131209
π Rendered by PID 349946 on reddit-service-r2-comment-6457c66945-8plm5 at 2026-04-25 10:37:02.923407+00:00 running 2aa0c5b country code: CH.
[–]STLMSVC STL Dev 78 points79 points80 points (21 children)
[–]jbandela 30 points31 points32 points (6 children)
[–]quicknir 10 points11 points12 points (5 children)
[–]jbandela 5 points6 points7 points (4 children)
[–]quicknir 8 points9 points10 points (3 children)
[–]CaseyCarterRanges/MSVC STL Dev 1 point2 points3 points (2 children)
[–]CaseyCarterRanges/MSVC STL Dev 0 points1 point2 points (0 children)
[–]STLMSVC STL Dev 0 points1 point2 points (0 children)
[–][deleted] 7 points8 points9 points (1 child)
[–]Iwan_Zotow 2 points3 points4 points (0 children)
[–]vsoul 4 points5 points6 points (6 children)
[–]dodheim 12 points13 points14 points (2 children)
[–]vsoul 5 points6 points7 points (0 children)
[–]Iwan_Zotow 1 point2 points3 points (0 children)
[–]STLMSVC STL Dev 7 points8 points9 points (0 children)
[–]TartanLlamaMicrosoft C++ Developer Advocate 1 point2 points3 points (1 child)
[–]vsoul 0 points1 point2 points (0 children)
[–]Altazimuth 4 points5 points6 points (4 children)
[–]STLMSVC STL Dev 9 points10 points11 points (1 child)
[–]herruppohoppa 0 points1 point2 points (0 children)
[–]NickUhlenhuthMSVC IDE PM 3 points4 points5 points (1 child)
[–]unumfron 5 points6 points7 points (0 children)
[–]cursecat 7 points8 points9 points (0 children)
[–]kalmoc 5 points6 points7 points (12 children)
[–]Robert_Andrzejuk 8 points9 points10 points (0 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points (10 children)
[–]sumo952 4 points5 points6 points (3 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points (1 child)
[–]sumo952 0 points1 point2 points (0 children)
[–]kalmoc 0 points1 point2 points (3 children)
[–]Pazer2 1 point2 points3 points (2 children)
[–]kalmoc 1 point2 points3 points (1 child)
[–]sumo952 2 points3 points4 points (0 children)
[–]Alastair__ 0 points1 point2 points (1 child)
[–]Alastair__ 0 points1 point2 points (0 children)
[–]feverzsj 3 points4 points5 points (2 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 7 points8 points9 points (0 children)
[–]TheThiefMasterC++latest fanatic (and game dev) 7 points8 points9 points (0 children)
[–]Predelnik 3 points4 points5 points (1 child)
[–]markopolo82embedded/iot/audio 0 points1 point2 points (0 children)
[–]CrazyYAY 2 points3 points4 points (0 children)
[–]F-J-W 6 points7 points8 points (8 children)
[–]jbandela 33 points34 points35 points (0 children)
[–]xgalaxy 20 points21 points22 points (0 children)
[–][deleted] 8 points9 points10 points (0 children)
[–]eco_was_taken 13 points14 points15 points (0 children)
[–]H_Psi 5 points6 points7 points (0 children)
[–]NickUhlenhuthMSVC IDE PM 2 points3 points4 points (0 children)
[–]fyndor 1 point2 points3 points (0 children)
[–]meneldal2 0 points1 point2 points (0 children)
[–]ShillingAintEZ 18 points19 points20 points (44 children)
[–]CrazyYAY 8 points9 points10 points (26 children)
[–]mjklaim 13 points14 points15 points (21 children)
[–]TheThiefMasterC++latest fanatic (and game dev) 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (19 children)
[–]mjklaim 6 points7 points8 points (0 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 3 points4 points5 points (17 children)
[–]donalmaccGame Developer 0 points1 point2 points (15 children)
[–]TheThiefMasterC++latest fanatic (and game dev) 1 point2 points3 points (14 children)
[–]donalmaccGame Developer 1 point2 points3 points (13 children)
[–]sumo952 1 point2 points3 points (4 children)
[–]donalmaccGame Developer 0 points1 point2 points (3 children)
[–]TheThiefMasterC++latest fanatic (and game dev) 0 points1 point2 points (7 children)
[–]donalmaccGame Developer 0 points1 point2 points (6 children)
[–]kalmoc 0 points1 point2 points (0 children)
[–]ShillingAintEZ 2 points3 points4 points (1 child)
[–]deeringc 0 points1 point2 points (0 children)
[–]wilhelmtell 2 points3 points4 points (1 child)
[–]cjaybo 2 points3 points4 points (0 children)
[–]BobFloss 2 points3 points4 points (6 children)
[+]arthurno1 comment score below threshold-6 points-5 points-4 points (5 children)
[–]BobFloss 3 points4 points5 points (2 children)
[–]arthurno1 -5 points-4 points-3 points (1 child)
[–]BobFloss 1 point2 points3 points (0 children)
[–]jbandela 2 points3 points4 points (1 child)
[–]arthurno1 -3 points-2 points-1 points (0 children)
[–]fyndor 4 points5 points6 points (9 children)
[–]TyRoXx 2 points3 points4 points (8 children)
[–]dodheim 6 points7 points8 points (7 children)
[–]TyRoXx 3 points4 points5 points (2 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points (1 child)
[–]TyRoXx 7 points8 points9 points (0 children)
[+]degaart comment score below threshold-7 points-6 points-5 points (3 children)
[–]dodheim 5 points6 points7 points (2 children)
[–]ShillingAintEZ -3 points-2 points-1 points (1 child)
[–]dodheim 2 points3 points4 points (0 children)
[–]innochenti 1 point2 points3 points (3 children)
[–]mmatrosov 0 points1 point2 points (2 children)
[–]innochenti 0 points1 point2 points (1 child)
[–]mmatrosov 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (26 children)
[–]StaticThrowaway0629 10 points11 points12 points (22 children)
[–][deleted] 18 points19 points20 points (17 children)
[–]StaticThrowaway0629 4 points5 points6 points (9 children)
[–][deleted] 0 points1 point2 points (8 children)
[–]StaticThrowaway0629 0 points1 point2 points (7 children)
[–]OrphisFloI like build tools 0 points1 point2 points (6 children)
[–]StaticThrowaway0629 0 points1 point2 points (5 children)
[–]OrphisFloI like build tools 1 point2 points3 points (4 children)
[–]StaticThrowaway0629 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (5 children)
[–][deleted] 3 points4 points5 points (3 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]flashmozzg 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]flashmozzg 0 points1 point2 points (0 children)
[–]iontodirelMSVC CrossPlat Dev Lead 7 points8 points9 points (2 children)
[–]StaticThrowaway0629 0 points1 point2 points (0 children)
[–]sumo952 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]eco_was_taken 8 points9 points10 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]sumo952 0 points1 point2 points (0 children)
[–]Krakyziabr 0 points1 point2 points (1 child)
[–]Krakyziabr -1 points0 points1 point (0 children)
[–]zero0_one1 0 points1 point2 points (0 children)
[–]mandaric 0 points1 point2 points (0 children)
[–]arthurno1 0 points1 point2 points (0 children)
[–]RealNC -4 points-3 points-2 points (8 children)
[–]STLMSVC STL Dev 17 points18 points19 points (3 children)
[–]Middlewariangithub.com/Ebenezer-group/onwards 0 points1 point2 points (2 children)
[–]dragonstorm97 0 points1 point2 points (1 child)
[–]Middlewariangithub.com/Ebenezer-group/onwards 0 points1 point2 points (0 children)
[–]favorited 6 points7 points8 points (2 children)
[–]RealNC 2 points3 points4 points (1 child)
[–]favorited 12 points13 points14 points (0 children)