What c++ version does CodeBlocks 13.12 use? - c++

I'm reading C++ Primer and there are some pieces of code that reqiure C++11. I know how to set the compiler to use this version, but I was wondering what it uses by default.

Codeblocks 13.12, which is only available for Mac, is a few years old and does not come bundled with any GCC. It's going to use whatever's available on your system. More than likely GCC on a Mac will actually be symlinked to Clang. Running gcc -v or clang++ -v should tell you the headers that are being used for compatibility.

Related

On Linux, what's the use of installing clang++ if it uses g++ libs only?

For C++ development on Linux, if I install clang and use it; it actually uses libstdc++(the g++ lib). What's the use of installing the frontend compiler clang on linux then?
I should be good with gcc/g++ only on a linux machine as that's a complete toolchain!
Note: I'm not an expert in C++.
libstdc++ is a default runtime on your Linux. libc++ is not installed by default. If you link your app to libc++, you have to add it as a runtime dependency.
You are right, gcc/g++ is good for Linux, moreover its diagnostic messages are more clear, thus the compiler is better for beginners. By using clang++, you need to know the C++ standard deeper, otherwise it's difficult to get an error reason.

where and how do i get gcc g++ 7.3.0

I would like to use SFML but at first place i need to get the same version of SFML and dev c++ compiler. It was easy to get the SFML 7.3.0 version, but i can't find the 7.3.0 version of compiler, even the MinGW installation manager doesn't have it, but i need it. I've tried searching the internet, but i found nothing that could possibly help me. The only way for me to use SFML, is using 4.9.2 version of compiler and SFML for now, but it's old and have a lot of bugs/oversights. So if u use SFML 7.3.0 or know how to get and use it, pls tell me how to.
I don't follow your statement that you need the MinGW GCC 7.3.0 compiler to build SFML 7.3.0.
When looking at SFML (https://www.sfml-dev.org/download.php) the latest version seems to be 2.5.1.
That version builds perfectly well with more recent versions of MinGW/MinGW-w64.In fact even the latest GCC 11.2.0 can build it - I used the 64-bit standalone build from https://winlibs.com/ to try this.
GCC 7.3.0 is several years old. There is usually no reason to use very old GCC versions. Instead you can tell GCC to use an older standard of the C language with the -std= flag (e.g. -std=c89).

Relationship between gcc, g++, cygwin, and wingw?

I know for my class, I had to install cygwin to get my Netbeans IDE running, but I see options during setup for both g++ and gcc and I am not sure if they are the same thing or not, and where does wingw? is it another compiler, and if so why choose on over the other?
g++ and gcc are the gnu C++ and C compiler respectively. They're really the same compiler with different flags though.
MinGW is "Minimalist Gnu for Windows". It's a port of the gnu compiler to run on Windows.
Cygwin is another port of the gnu compiler (and various other utilities) to Windows. More accurately (IMO, anyway), it's leaving the compiler/programs running on POSIX, and porting a POSIX layer to run on Windows.
As to choosing between them: if you're running Linux, you probably want ot just get a package of gcc/g++ for the distro you're using.
If you're running Windows, it'll depend on your intent. Cygwin works well for porting existing Linux/POSIX code to Windows. If, however, you plan to write code, and just want a compiler, I'd go for MinGW instead.
One other note: the MinGW at MinGW.org hasn't been updated in years. If you decide to go with MinGW, I'd advise getting it from nuwen.net instead (it's updated quite regularly).
gcc will compile: .c/.cpp files as C and C++ respectively.
g++ will compile: .c/.cpp files but they will all be treated as
C++ files.
Also if you use g++ to link the object files it automatically
links in the std C++ libraries (gcc does not do this).
gcc compiling C files has less predefined macros.
For wingw, did you mean mingw? Because MinGW is for compatibility with Windows. MinGW uses GCC/G++, and MinGW is not a compiler, it's basically a stripped version of Cygwin that uses MS libs wherever possible.
Depends upon what you are building;
gcc is for C programs.
g++ is for C++ programs.
I've not heard of wingw.

Know g++ Version of Code blocks in Windows

I am solving questions on Interviewstreet.com. They said they use C++ version g++ 4.6.3,C0x mode.
I am writing code on code blocks. So i want to know which version iam using in code blocks is it in C0x mode or C11 mode??
I have tried using g++ --version i got g++ TDM-2 mingw32 4.4.1.Can u tell me where i can get this kind of information.
what is the difference between C++ 0x and C++11??
You'll have to update the version of g++ to 4.6.3 (or later) if you want to use c++11 features. See this question and it's answers on how to do it for deb linux.
Then you'll have to pass --std=c++0x to the compiler in options. You should be able to easily find them in codeblocks.
what is the difference between C++ 0x and C++11??
c++0x is a synonym for c++11.
The command:
g++ --version
gives you the version of your g++ or mingw compiler. Since you got g++ TDM-2 mingw32 4.4.1 then your version is 4.4.1. If you want to use version 4.6.3 as in that web site, then you would have to update.
It wouldn't hurt to use a newer than 4.6.3 version of mingw, so please see here for the latest version. This page offers an windows installer for mingw.
After installation, you would have to configure CodeBlocks to use the newly installed compiler by looking into Compiler and debugger settings -> Toolchain executables tab and setting the paths for the compiler-related executables to the new ones.
Hope this helps.
EDIT:
Here is a small tutorial/example of what the CodeBlocks settings look like.

Where can I download GCC 4.3.2 binaries for Windows?

I have to write a c++ program, and i want to do this in vstudio 2010, because it's the most comfortable way for me. But later this code will be compiled in gcc 4.3.2 (ejudge). I can't find gcc 4.3.2 binaries for Windows, if there any ways to check correctness of gcc compilation? Or maybe anyone will help to find gcc binaries? I found this link http://tdm-gcc.tdragon.net/download but there i can't find 4.3.2 version binaries, only source code. Thanks.
MinGW, or Minimalist GNU for Windows, is a set of GNU compilers for Windows platforms. It's the easiest way to use G++ on windows platform. You could also use Cygwin, but it would be a bit of overkill.
As I recall g++ 4.3.2 was used in an older version of the Code::Blocks IDE, as the bundled compiler.
However, I'm currently unable to connect to [http://www.codeblocks.org], so I don't know if they provide downloads of older versions.