Hi everybody, I really thank you for the help you always provide. I am working with “Microsoft Visual Studio 2008, C++”, because my entire old programs have been made in this software.
I am trying to let my program runs in different machine. I know that I have to have “*.exe” and “*.dll“ files. But I do not know where to find them. Can anybody tell me where to find them and how can I prepare it so that it can work in different machine
By default, you'll need to install the VC++ runtime redistributables on the system you want to run the exe on. Try a simple "hello world" program first. There is an option to package these with the program itself, but I haven't done that.
DLLs aren't always needed. Does your solution produce DLL files? Does it say a particular DLL is missing when you attempt to run the program on another computer?
Let's say you have a project call "FooProj". Within the FooProj project folder, there will be folders like "bin" or "Release" or similar. Look in those folders and you should see the .exe for your program.
You could set your project's options to not use the C/C++ runtime library DLLs by statically linking the runtime routines into your executable.
To set the project's build options, in the Solution Explorer, click on the project name so that it is highlighted. From the Project menu, choose Properties. The Property Pages window opens.
The following steps are from VS 2017/2019, but they should be similar with 2008.....
Property Pages->Configuration Properties->C/C++->Code Generation. You should see a Runtime Library option setting.
Set the Platform dropdown menu to "All Platforms". That ensures x86 and x64 builds are built the same.
Set the Configuration dropdown menu to Debug, and then the Runtime Library switch option that doesn't show Debug DLL. With 2017/2019 the only options are multi-threaded, 2008 might have single-threaded options.
Set the Configuration dropdown menu to Debug, and then the Runtime Library switch option that doesn't show DLL.
If you've properly set the Runtime Library options rebuild your app. The file size will increase. A lot bigger vs. using the C/C++ runtime libraries, but your app should now only require standard Windows DLL files that every Windows PC has.
A bit more work, but now your app should run without the VC++ runtime redistributables on the target machines.
The VC++ runtime DLLs might have already been installed from some other program, it looks like they are part of Win10 anyway.