Compiler that supports c++11 for Windows vista - c++11

I'm currently studying a book regarding C++, which is quite new. Therefore it also discusses C++11 in some parts. Having Windows Vista, I can't download the latest version of Visual Express, so I'll have to do with the 2010 version. This doesn't support C++11, so I'm currently wondering whether there exists a free alternative which does support C++11.
p.s. - Would you say it's essential/important for a beginner in programming to learn C++11 as well (instead of just the core basics)?

You could consider using virtual machine with a Linux flavor. I had the same problem as you, I installed VirtualBox, then Ubuntu having the latest g++ compiler

You could compile and use Clang on Windows Vista and integrate it to Visual Studio. They have an almost complete support for C++11 now (as of version 3.3).

Related

VS2010 with C++11 all feature support using QT creator

I would like to ask a question about VS2010 IDE environment with all the C++11 features. Currently we need to build our software where some libraries need C++11 all feature support but we are now still running VS2010 environment and currently we are not upgrading our VS2010 to VS2017 at this moment.
So Is there any way to build these library with alternative mentods like installing QT creator on Windows platform so that can use g++ 4.9.3 or later same as on linux ubuntu? I found some website mentioning about Cygwin installed on Windows but seems not clear how to do.
Thanks for your help!
The QT installer provides binary versions built with MinGW as well as MinGW itself, so just use those.

gcc can't find cuda_runtime.h even though path is provided with -I flag (cygwin) [duplicate]

I'm trying to build a simple application with CUDA and I've been trying for hours on end and I just can't make it work on windows. nvcc absolutely refuses to compile without Visual Studio's compiler which doesn't support things I need. I tried building using nvcc with clang but It just asks me to use Visual Studio's compiler. I've also tried using clang directly since it now supports CUDA but I receive this error:
clang++.exe: error: Unsupported CUDA gpu architecture: compute_52
This makes no sense to me because I have the CUDA toolkit version 7.5 and my graphics card is a GTX 970 (two of them). I have googled this extensively and everywhere I come across the error the person always has is their CUDA toolkit is < 7.5. I'm on the brink of tears right now trying to get something as simple as VLA to work on this CUDA application and I just can't achieve it...
The CUDA windows toolchain requires the Visual Studio C++ compiler. You cannot use anything else on that platform. If the VS compiler doesn't support the language features you need within CUDA host code, you have no choice but to change platforms, or your expectations.
You can still potentially compile non-CUDA host code using another compiler and then link that code using NVCC and the VS toolchain.
Try to use clang-cl, --cubin=clang-cl.exe
It may be worth to work on a Linux VM or WSL2 within windows. As per the CUDA docs.
To compile new CUDA applications, a CUDA Toolkit for Linux x86 is
needed. CUDA Toolkit support for WSL is still in preview stage as
developer tools such as profilers are not available yet. However, CUDA
application development is fully supported in the WSL2 environment, as
a result, users should be able to compile new CUDA Linux applications
with the latest CUDA Toolkit for x86 Linux.
https://docs.nvidia.com/cuda/wsl-user-guide/index.html#:~:text=However%2C%20CUDA%20application%20development%20is,becomes%20available%20within%20WSL%202.

c++ 11 availablity for platforms that run java 7

At work we develop software that uses java7 and C++03, I would like to get my team to replace c++03 and instead embrace C++11. Can I assure them that every OS that runs java7 has also a gcc compiler for C++11?
I know the relation I make between java7 and c++11 is somewhat weird, but that's my way of saying we need to support some old OSes, but not that old that they don't run java7.
Thanks
It depends on whether you follow the sys specs for java 7 or not. There might be a way to force it to run on earlier versions of the mentioned OSs, but it is not officially specified so. take a look at the requirements:
Java 7 & 8 Sys Req
Now, for the listed OSs I am sure that GCC 4.7.2 is available (or it can be compiled). For windows, MS provides support for C++11 starting with VS 2010 which runs on Win XP or newer (if you don't like something like Cygwin).
The problem with all this is that it depends on how many C++11 features you actually need. For instance, Visual Studio 2010 doesn't support all C++11 features. Take a look at the following table to see what is supported in each compiler:
C++ compiler support

Qt development in windows. Do I need pay for Microsoft tools?

Considering to develop a desktop application with Qt for Windows. It will be a free download application, but for a commecial SERVICE. (need an account with our commercial service to work).
I think we could use the Qt for Windows from Nokia (LGLP version) because its free app. But the lastest one version of Qt needs a C++ complier from Microsoft.
Which one?
Do I need to pay for an C++ compiler from Microsoft, or do they have a free version to use with Qt?
Reading info docs, googling and we still cann't understand what tools do I need.
If you want to use the Visual Studio compilers, you can download the free Windows SDK. The following link takes you to the SDK for Visual Studio 2008:
Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
This includes all the C++ compilers and tools you need. (There is a more recent version available, but Visual Studio 2010 is not yet a "level 1 supported" platform for Qt.) We are using this on standalone build machines and it works fine.
Just a personal opinion, but we have found that using anything other than MSVC on Windows (for example, MinGW) causes a lot of problems. It is not that the other toolchains are bad, it is just that they are all treated as second-class citizens. We had lots of problems with third-party libraries not being able to build in MinGW or having nonexistent build instructions and having to do a lot of manual Makefile editing, etc. You are much more likely to have things "just work" if using MSVC.
For the most part (static linking), you cannot mix and match. You need to pick one toolchain and stick with it. If I were starting from scratch, I'd definitely go with MSVC.
Just our experience (we started with MinGW); your mileage may vary.
No, you do not need to pay for anything.
The Microsoft toolchain is available for free as part of the Microsoft Windows Software Development Kit.
Additionally, the following article may also be of interest to you:
Developing Windows Applications in C++: The tools you need
The alternative supported by Qt is MinGW. The runtime libraries are free from copyright, so you can do whatever you want with them.
It is basically the Windows counterpart of the GNU Compiler Collection (GCC) under Unix.

Boost thread local storage in Windows threads

I tried to use Boost thread local storage with Windows threads. I built the project without any problems.
However my question here is, is it okay to use Boost TLS with Windows threads?
Edit
Yes Boost is integrally supported on windows with all major compilers:
Supported compilers and platforms
The library should build and work with a reasonably compliant compiler. The library was > successfully built and tested on the following platforms:
Windows XP, Windows Vista. MSVC 8.0, 9.0. MSVC 7.1 may work too, but it was not tested.
Windows Vista. Intel C++ Compiler 10.1.022, 11.1.048.
Linux. GCC 4.2 and newer. GCC 4.1 may work too, but it was not tested.
Linux. Intel C++ 11.1.056.
The following compilers/platforms are not supported and will likely fail to compile the library:
MSVC 7.0 and older.
Borland C++ 5.5.1 (free version). Newer versions might or might not work.
GCC 4.0 and older.
Windows 9x, ME, NT4 and older are not supported.
I suppose you mean what "libraries do I need"?
You need to link to the import library for boost threads, usually a file like
C:\Program Files\boost\boot_1_47_0\lib\libboost_pthread....lib
This file can be added to the additional libraries to link box in the c++ linker settings. Don't forget to add it for debug and release builds.
PS. don't have Windows handy right now, so I can't do the screen shots.

Resources