what is the difference between native c++ compiler and .net c++ compiler? - c++

what is the difference between native c++ compiler and .net c++ compiler? Just for curiosity one of my friend asked me this question.

In general .net C++ compiler is a compiler that can compile C++/CLI code and generates intermediate object code.
While native c++ compiler is a compiler that knows nothing about C++/CLI and designed to compile C++ code.

Related

Integration of Rcpp in c++ with bcc compiler

Hi I`m looking for a library in c++ which i compile with the borland compiler bcc32.
Before I tried to take the benefits of RInside but unfortunately it´s only working with gcc-compiler and can´t be used in my programming environment, wich is Embarcadero.
Is it possible to use Rcpp with a bcc32 compiler?
Are there compatitible librarys on the market doing statistical calculations in c++
I hope you can help me. Thanks.
Part 1: no. From the Rcpp FAQ:
1.3. What compiler can I use. On almost all platforms, the GNU
Compiler Collection (or gcc, which is also the name of its
C language compiler) has to be used along with the corresponding
g++ compiler for the
C++ language. ...
The
clang
and
clang++
compilers from the LLVM project can
also be used ...
The Intel
icc
family has also been used successfully as its output
files can also be combined with those from
gcc
.
If it's not on that list, it's not supported.
Part 2: off topic for StackOverflow.

Borland C++ is not C++?

One of my career courses is teaching us the basics of "Turbo C". I was never sure if it was C or C++. So i checked the help and it said "Borland C++ Version 3.0".
But when i go look for help on the web, my code seems to be C.
So which one is it or why is it all mixed?
You are able to compile C code with a C++ compiler, with minor changes to the code in some cases.
So even if your code is C there is no problem that you are using Borland C++.
It is even possible that the compiler will detect that it is a C file and apply different rules.
To check what your compiler is doing, try this program:
int new;
int main() { return 0; }
If this compiles then you are using a C compiler; if not then you are using a C++ compiler. You may be able to control your compiler using compiler switches or by changing the extension of the file you are compiling.
The oldest compiler by Borland was "Turbo C". It had no C++ support. But later they added C++, so the compiler was renamed to "Turbo C/C++" and then to "Borland C/C++". All these compilers were backward compatible so sometimes people still refer to "Turbo C" while really speaking of Borland C++ etc.
BTW. Borland's compiler chooses "C" or "C++" mode depending on source file extension.
From wikipedia
In May 1990, Borland replaced Turbo C with Turbo C++.
The name "Turbo C" was not used after version 2.0, because with the release of Turbo C++ 1.0 in 1990, the two products were folded into a single product.
You will be able to directly use most C programs in c++ with just a few changes to the code. Most part of C is supported on C++.

CUDA with C++ Builder

How can I use CUDA with C++ builder? Do I have to use a wrapper to do a basic CUDA computation? I searched and there is no info how to set the CUDA SDK for C++ builder.
NVIDIA's API is C-compatible, and C++ builder compiles to native, they also happen to support conventional calling conventions for C.
CUDA has a kernel compiler that allows you to mix C/C++ code with CUDA code in the same file... but I think they sort of embed a gcc version in the toolkit. I had a project where I was mixing code produced by another gcc version, and the easiest thing was to isolate CUDA coda in a library that I compiled with their nvcc, and then linked with the code produced by my gcc version. In my case, I had it easy: the C++ compilers had in common calling and name-mangling convention.
So, you basically have three choices:
Use CUDA's nvcc and gcc to generate C libraries that you can link with from C++ builder.
Trick nvcc to generate C code and try to compile it with C++ builder. I didn't succeed on this however.
Ditch C++ builder, you can still get nice multi-platform graphical user-interfaces using QT-creator with gcc/visual-studio

What does Microsoft C/C++ Optimizing Compiler compile down to

I was just curious by default does Microsoft's C/C++ Optimizing Compiler compile down to machine language or byte code?
It compiles down to machine language (microprocessor opcodes) by default, or CIL, using the /clr switch.
For comparison, C# and Visual Basic compile to CIL, and Visual Basic 6 can compile to either P-code (a form of byte code) or native code (machine language).
It can do both.
By default it produces native machine code.
With the /clr command line option it will produce .NET IL byte code.

visual c++ and C++ builder

Can C++builder compile any c++ source files.
I don't have a good knowledge in c++. but i have some experience in delphi.
I like to use c++ but confused which one to use
I know that cbuilder has vcl , easy to develop ,easy for delphi developer
But my problem is can it compile any c++ files (vc++ and other source files).
is it compatible with vc++ (excluding MFC and VCL). Can i use any APIs with c++builder
You'll find C++ Builder very comfy coming from Delphi if you don't care about MFC or .NET via C++/CLI etc and just want native C++ then either will work for you. Visual Studio 2010 supports a lot of the new C++0x features which is pretty nice, although they don't have variadic templates yet. I'm not sure how much of C++0x is in C++ Builder as yet but that could be worth looking into as a deciding factor.
It should be able to compile any standards conforming code. If the code uses extensions that another compiler provides, it will more than likely have problems. VC++ has quite a few extensions that are on by default and so someone using that compiler might use them with out realizing what is going on(the same applies to G++ the other major C++ compiler out there.)
In my experience, C++Builder's support for more advanced C++ code is limited. For example, many of Boost's libraries are unsupported in C++Builder, and I've often had to modify other open source libraries to get them to build properly in C++Builder (due to various bugs or limitations in C++Builder's compiler). Simpler C++ code can work without any problems.
So, depending on what C++ libraries / source files / APIs you're wanting to use, getting them to work in C++Builder may be very straightforward, or it may take significant work.
You can download a free version of C++ Builder at www.embarcadero.com. With that, you can test your libraries for compatibility.