Creating portable stand alone application in Visual Studio.

Jan 21, 2014 at 5:58am
Hi folks and gurus,

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.

Jan 21, 2014 at 6:00am
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.
Jan 21, 2014 at 6:10am
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?

Jan 21, 2014 at 6:21am
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
Jan 21, 2014 at 6:35am
in fact, you ease up my job and tomorrow class.

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.
Last edited on Jan 21, 2014 at 6:36am
Jan 21, 2014 at 6:47am
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.
Jan 21, 2014 at 7:04am
> 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.
Jan 21, 2014 at 7:05am
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.

A little "thank you" for a "big favour".
Jan 21, 2014 at 7:13am
32-bit programs will work 99% of the time on 64-bit computers, but 64-bit programs will never work on 32-bit computers without emulation.
Jan 21, 2014 at 7:14am
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.
Jan 21, 2014 at 8:13am
My class fellow in my group just confirmed that last compiled exe runs perfect without any further requirements of MSVCP110.dll and MSVCR110.dll.

Is it not portable or stand-alone?
Jan 21, 2014 at 1:12pm
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.
Topic archived. No new replies allowed.