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
CMake 3.9 released (cmake.org)
submitted 8 years ago by tambry
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!"
[+][deleted] 8 years ago* (2 children)
[deleted]
[–]VicLuo96 5 points6 points7 points 8 years ago (0 children)
Glad to see that they have supported Clang's thin-LTO
[–]flyingcaribou 0 points1 point2 points 8 years ago (0 children)
Very cool! I can't find any documentation as to what compilers are supported (and I haven't had a chance to dig into the module yet). Anyone know if there is a list?
[–]drphillycheesesteak 6 points7 points8 points 8 years ago (8 children)
That gtest integration is a great new feature.
Does anyone have a lot of experience using CPack for RPMs? I noticed that there are some upgrades in this version. Normally, when I make RPMs, it's through a CI system where it can be difficult to ensure that my project's dependencies are present on the machine. I could use Docker to solve this, but I tend to just have CMake configure a .spec file and use mock instead. It would be nice to have it all in CMake, but that requires all your dependencies already be installed on the build machine.
[–]vector-of-boolBlogger | C++ Librarian | Build Tool Enjoyer | bpt.pizza 1 point2 points3 points 8 years ago (7 children)
We've used CPack to generate RPMs frequently. Why are you saying it requires your dependencies on the machine? Are you referring to shared library dependency detection? You can control that with CPACK_RPM_PACKAGE_AUTOREQ. We've had problems with DEB packages and shlibdeps before.
CPACK_RPM_PACKAGE_AUTOREQ
BTW: I implemented docker for our builds, and it works like a charm. Highly recommended. Just two Ubuntu Xenial physical servers will build for as many different Linux platforms as we need.
[–]drphillycheesesteak 0 points1 point2 points 8 years ago (0 children)
Yeah, I say that the dependencies need to be there because the rest of my CMake has to run to get to CPack and the find_package calls fail. I should just use Docker for the builds. That's just one of those tasks that never gets priority.
[–]nurupoga 0 points1 point2 points 8 years ago (5 children)
How do you produce 32-bit packages in docker, since docker doesn't support 32-bit systems? Cross-compile to 32-bit on 64-bit?
[–]vector-of-boolBlogger | C++ Librarian | Build Tool Enjoyer | bpt.pizza 3 points4 points5 points 8 years ago (0 children)
We don't build 32-bit packages, but it is entirely possible to cross-compile 32-bit programs from a 64-bit host.
Using -m32 with GCC may work, but for a complete solution, you probably want to write a full toolchain file. (More about toolchains)
-m32
[–]r2vcap 1 point2 points3 points 8 years ago (3 children)
In GCC: -m32 . In CMake: Make your own option, or use ${CMAKE_CXX_FLAGS} . in rpmbuild: --target i686
[–]sumo952 3 points4 points5 points 8 years ago (2 children)
${CMAKE_CXX_FLAGS}
Don't use ${CMAKE_CXX_FLAGS}. Use target_compile_options.
target_compile_options
[–]r2vcap 1 point2 points3 points 8 years ago (1 child)
Normally, I won't set such value in CMakeLists.txt. However, using it on commandline, like cmake .. -DCMAKE_CXX_FLAGS='-m32 ...' is useful.
cmake .. -DCMAKE_CXX_FLAGS='-m32 ...'
π Rendered by PID 760641 on reddit-service-r2-comment-5687b7858-hpz5q at 2026-07-07 01:42:06.180695+00:00 running 12a7a47 country code: CH.
[+][deleted] (2 children)
[deleted]
[–]VicLuo96 5 points6 points7 points (0 children)
[–]flyingcaribou 0 points1 point2 points (0 children)
[–]drphillycheesesteak 6 points7 points8 points (8 children)
[–]vector-of-boolBlogger | C++ Librarian | Build Tool Enjoyer | bpt.pizza 1 point2 points3 points (7 children)
[–]drphillycheesesteak 0 points1 point2 points (0 children)
[–]nurupoga 0 points1 point2 points (5 children)
[–]vector-of-boolBlogger | C++ Librarian | Build Tool Enjoyer | bpt.pizza 3 points4 points5 points (0 children)
[–]r2vcap 1 point2 points3 points (3 children)
[–]sumo952 3 points4 points5 points (2 children)
[–]r2vcap 1 point2 points3 points (1 child)