What C++ compiler would compile without mistakes source codes of this publication for game developing? - c++

http://cws.cengage.co.uk/rautenbach/students/ancillary_content/C++.pdf
I tried with different compilers but I received many errors

Quote from the book:
The examples provided in this book are 100% cross platform and will compile on any ANSI compiler. All the C++ examples were tested on Linux and Windows XP/Vista via the MinGW compiler and Microsoft Visual Studio 2005.
Note that they recommend a 10 year old compiler, this from a book teaching cutting edge technology -- GPU programming. Consider throwing it out.

For what I see you need Visual C++ from Visual Studio 2008 or higher and the DirectX SDK.

Related

Code Analysis Not Available in This Edition of the Compiler

I'm trying to run code analysis for the first time on my native C++ application. I'm developing using Visual Studio 2013 Ultimate and compiling using the Visual C++ Compiler Nov 2013 CTP (CTP_Nov2013), which is the latest (I believe) compiler from MS for C++11. When trying to run Code Analysis I receive the following warning:
warning D9040: ignoring option '/analyze'; Code Analysis warnings are not available in this edition of the compiler
So I'm wondering if it's because I'm using this new compiler that it's not able to run code analysis or what. But I couldn't find any answers by briefly Googling. The MSDN for Visual Studio says code analysis works for all version of VS except Express. Any help would be appreciated, and if it's a "No it doesn't work with that compiler" then that's fine. Just wondering. Thanks!
It seems to work only for x86 builds. If you're doing an x64 build, it won't be available.

Using different compiler in Visual Studio

This maybe a beginner question but could not find proper answer on the internet.
I am curious can I use some other compiler (which I like) in Visual Studio 10?
As of Visual Studio 2010, it is conceptually possible to integrate another compiler. In the book ‘Inside the Microsoft Build Engine, Using MSBuild and Team Foundation Buid’ 2nd edition, on page 338, the chapter ‘Adding a New Platform and Platform Toolset’ the process of adding gcc to visual studio is explained.
However, while it is possible, it has always remained as a concept. To my awareness, nobody has actually been up to the task and publicly disclosed the results. But even with this support, you'd still be lacking debugging facilities. Which would require your compiler of choice to generate .pdb files and/or extend visual studio with a new local debugger
In summary it's quite a venture
You can use other compiler Intel c++ in VS. I don't think any other compiler supports VS.The main reason behind it is lack of plug-ins in VS. But you can use cmake scripts to compile your code in different compilers. With eclipse you can use most of the compilers (VS,gcc). Code blocks also allows you to choose the compilers.
Yes,you can use Intel C++,and even MATLAB 7.1 or later for sure..here is a reference to use MATLABIt gives a step by step procedure to use MATLAB with VS
You can also write Java programs and include javac compiler for it...you can refer this if needed..Including javac with VS
I kno this is surely possible from VS 2010 but not sure for the b4 editions..hope it helps..

Compiler used by Visual Studio for C++?

I have tried searching on the internet but could not find out the compiler used by Visual Studio for C++ applications.
I wanted to know whether it is freely available & whether it can be used for commercial applications.
Traditionally I have been using Turbo C++.
The problem with Visual Studio C++ Express is that it does not work with some applications.
For example, BRL-CAD which is an open source project works properly with the commercial version but gives some problems for the Express edition.
It seems that there is some problem with MinGW compiler as well.
I am told this by the people running that project.
Visual Studio uses the same compiler for all editions. So, the Express edition uses the same compiler as the Professional edition. There are also no restrictions on producing commercial applications, in either case. There are differences in the advanced features offered by the IDE, but the compilers are the same. So whatever your problems are in getting the project to work, it is nothing to do with the compiler.

Using a pure C++ compiler versus Visual C++

I searched around for the answers to these questions, but I have had little luck. So, I thought I would post them here to get some clarification. If this is a duplicate, please let me know, and I will close this.
Okay, with that said, I would like to begin learning C++. I come from a C# background and I have a great respect for Visual Studio and what it can do. Now, my question is. How well does Visual Studio's compiler work for C++ as opposed to a non-Microsoft version (such as MinGW)?
My thing is this. I have nothing wrong with Microsoft, but I would really like to learn C++ in a "pure" form and not scewed by any particular implementation. How reliant is Visual C++ on the .NET Framework? Can a "pure" C++ application be created through Visual Studio without any .NET usage or overhead? Does the Visual Studio compiler compile C++ into CIL like it does with C#/VB, or does it compile it all the way down as others do?
Thanks for any help anyone can provide!
The Visual C++ compiler will compile C++ code into standalone EXEs that have nothing to do with the .NET framework.
The only way to get the .NET baggage thrown in is to compile the C++ as "managed".
If you create a new project (File|New|New Project) Then choose "Win32" from the Visual C++ submenu in the project types and choose "Win32 Console Application" Visual studio will create a simple project with a couple of source files that will compile to a little executable.
Most of the time, Visual C++ is very similar to other compilers. Avoid #pragmas, microsoft libraries (MFC, ATL) and you should be fine.
Edit (thanks Cheeso) - Documentation of where Visual C++ diverges from standard.
In general I would advise using boost libraries for threads and networking because they work on many platforms (i.e linux). Also if your code can compile in GCC and Visual Studio then you are doing a good job keeping it portable.
The most recent versions of VC++ have become significantly more compliant to the C++ standard, so it's not really an issue to write "pure" C++ using Visual Studio, presuming that you stay out of the Windows API, COM+ and ATL. In fact, the documentation with Visual Studio is very rich, with details on the standard libraries and the STL, so it can help you learn a great deal. It can't teach you everything, but it's certainly loaded up with a wealth of information that is portable to any compiler and it is very easily accessbible inside the IDE.
If you create a new solution you should choose new Win32 Project, or Win32 Console Application, and check the 'Empty Project' option. Then you can add a main.cpp file, and add your standard C++ code.
If you like Visual Studio, go ahead and use it to learn C++ -- I haven't used the very latest version, but even the previous one was pretty standards-compliant, C++-wise, and I assume the latest one can only have gotten better. You can have many different kinds of project in Visual Studio, including "console apps", which are the "plain vanilla" kind you could make on any platform, and also many other kinds, such as, windows apps using the good old win32 api, ones made with MFC or other frameworks older than .NET, .NET ones using "managed code", etc.
Just make sure you always work in a "console app" project, and you'll be operating pretty closely to how you would be on other platforms and/or with other C++ IDEs.
If you limit yourself to writing ANSI C++ compliant code then what you write in VS will work in other compilers, until you have to interact with a graphic interface or IO. Then you need to make certain that you are using something that is portable, such as OpenGL, and not DirectX.
To set your project the steps here may be useful:
http://bytes.com/topic/net/answers/447572-strict-ansi-c
Microsoft Visual Studio 2005 comes with a very good, C++98 standard compliant pure C++ compiler. If you are interested in pure C++, don't forget to disable language extensions in project settings and you are good to go. Nobody is going to force you to use .NET framework, MFC or anyting like that. Just pure core C++ language and C++ standard library.
Of course, just like any other compiler, it has known non-compliance issues, but in general it is, again, surprisingly good. Older versions of their compiler (MS VS 6.0 specifically) suffered from many non-compliance problems and could not even compile its own header files with language extensions disabled. In 2005 version they fixed a lot of these issues.
After creating a standard Win32 project, you can turn up the compliance a bit more. On the project properties sheet, there's a C/C++ category, with a Language entry. This lists a number of cases where VC++ can differ from the standard. Here, you'd want to turn OFF language extensions, and turn ON "wchar_t as built-in type", "for-loop conformance" and "RTTI support".

What is the difference between "VC++" and "C++"?

Someone asked me how familiar I am with VC++ and how familiar I am with C++. What is the difference?
C++ is the actual language, VC++ is Microsoft's Visual C++, an IDE for C++ development.
From stason.org:
C++ is the programming language, Visual C++ is Microsoft's implementation of it.
When people talk about learning Visual C++, it usually has more to do with learning how to use the programming environment, and how to use the Microsoft Foundation Classes (MFCs) for Windows rather than any language issues. Visual C++ can and will compile straight C and C++.
C++ is the name of a programming language that has been approved by international standards committees (ANSI/ISO).
VC++ (“Visual C++”) is the product name of Microsoft's C++ compiler and sometimes, but not officially, the IDE it's shipped with (“Visual Studio”).
Well, Visual C++ used to stand for the Microsoft C++ compiler plus the MFC library. Basically there's no difference in the language itself, but VC++ includes a library, and some IDE support, for easily building GUIs.
vc++ is a development environment and c++ is a language
VC++ means different things to different people. You can use the Visual Studio environment to build (almost) standard C++ applications. You can also use it for Micrososft-specific additions - which vary from version to version. For example, the MFC components for windows applications, or the newer C++/CLI for .NET applications
VC++ is short for Visual C++, and is an IDE (integrated development environment) developed by Microsoft, included as part of Visual Studio. C++ is a language.
C++ is a language, VC++ (Visual C++) is a Microsoft development environment which was a forerunner to Visual Studio which helps you write C++.
You can know everything there is to know about C++ and never have seen VC++.
VC++ is IDE developed by Microsoft using microsoft c++ compiler.while C++ is the programming language.
Visual C++ and C++ are two entirely different things. They are related, though.
C++ is a high-level programming language that a compiler translates into machine code a computer can understand and execute.
Visual C++ is a tool created by Microsoft to make writing, compiling and debugging C++ source code easier. Visual C++ is an Integrated Development Environment (IDE).
http://www.cplusplus.com/forum/beginner/172353/
In some cases, they refer to its corresponding C++ implementation and its compilers.
C++ refers to standard headers/functions and its GCC C++ compiler.
VC++ refers to Microsoft implementation of C++ standard and its VC++
compiler.
They are not compatible with each other. Linux network/threading functions, numeric data types are different than its Windows counterpart. You can't compile Linux C++ code directly in Windows without using third-party GCC ports such as Cygwin/MinGW.
Most academic/research tools and libraries are written in C++ (GCC), and one will have the hard time to compile those in VC++.