I am an absolute newbie. I just wrote a simple program for temperature unit conversion from deg F to deg C as a my school assignment in VS 2012 Express Edition.
When I send compiled EXE file to my tutor and other class fellows, they said compiled win 32 file is not portable and stand alone. It requires MSVCP110.dll and MSVCR110.dll.
How can I compile same program to be completely stand-alone portable win32 application? So that it can run without any further requirement of MSVCP110.dll and MSVCR110.dll.
Executables are not portable in ever, however, what you really mean is 'independent'. Try building in Release instead of Debug - there should be a toolbar with a dropdown to change this.
I did build and compile in release instead of Debug but still it requires MSVCP100.dll and MSVCR100.dll. I did same program compilation in CodeBlocks, it does not require any dlls any more. But, my tutor always prefer MS Visual Studio.
Which toolbar with a dropdown menu you are referring to?
Ah, then check in the properties -> C/C++ -> Code Generation -> Runtime Library and make sure it is set to an option that does not say "debug" or "DLL" in it: http://i.imgur.com/5EJy3hj.png
Temperature Conversion Project Properties (spanner) -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded (/MT) worked as you stated with pic.
now size of exe increased, is it normal?
How can I save Runtime Multi threaded (/MT) to default template?
so I do not have to worry about further assignment.
I don't know, it's just something I remember to do. Usually it is already like that when you create a new Blank Project instead of the glitchy win32 console project.
> I just wrote a simple program (...) as a my school assignment
> When I send compiled EXE file to my tutor
¿what's the point in sending the executable?
¿wouldn't they be more interested in the source code?
> So that it can run without any further requirement of MSVCP110.dll and MSVCR110.dll.
Figure out what libraries your program needs http://linux.die.net/man/1/ldd
ask the client to install them, or provide them along with the executable (¿?)
> now size of exe increased, is it normal?
I suppose that you are using static linking now, so the executable would have the function embed instead of looking in the libraries.
last question,
In my school all PCs are 64 bit, but I have 32 bit in my home.
Hope this win32 console temp conversion.exe will run on 64 bit machine as well.
source code is simple and based on formula (°F - 32) x 5/9 = °C
Tutor will discuss the source code tomorrow, but, I want to be ready compiled and working program.
By being a Windows executable, it is not portable but is, by definition, a "stand-alone executable". As I said before, the word you are looking for is 'independent' - it is no longer dependent on those DLL files.