I am working on an ARM64 computer with Windows 10 (Windows ARM).
I have installed Visual Studio Community. I can create C/C++ Console programs. It works fine. But generated binary files are compiled for an ARM target.
Is there a way to generate x86 (or x86_64) binary files ?
I have looked inside project configuration but I did not find anything.
Do you know where I can select binary output platform in visual studio ?
Thanks
If you used the "Console App" template for C++ when you created the project, then the project was probably created with two 'platform' configurations: x64 and win32. Change the "active platform" to 'win32'. You can make that change in the "Configuration Manager" or in the standard toolbar.
Related
I have a fairly large project in Visual Studio 2010
I can build the project in both Debug and Release mode, copy the generated exe file along with a custom dll I need for a function in the program to another computer, and the exe file works without any problems
I am trying to make an installer for this project in Visual Studio 2010, following the instructions here: https://www.technical-recipes.com/2011/how-to-create-an-installer-in-microsoft-visual-studio/
I do not get any errors while building the installer, and I get a setup.exe and an msi file as a result, but if I install my program in another computer (not by development machine), when I try to run my program after installation I get a missing api-ms-win-crt-runtime-l1-1-0.dll error
How do I debug this problem? Since I can simply copy my Release or Debug build to the computer and make it work, doesn't it mean all the dll files my program is dependent on already exists in the other computer? And if this already works, why isn't the installer version working? How do I make sure that everything I need for this program is included in the installer?
My project in MFC dialog based and uses one third party library, for which I have both .lib and .dll file available. I need to do this in Visual Studio 2010. My development machine is Windows 10 64 bit Home edition version 1909. The installer I currently create installs my program in Program Files (x86) folder.
Static Linking MFC: It appears this issue was solved by making sure to statically link to MFC libraries. In the VC++ project: enable the setting: "include MFC in a static library". This enables static linking of MFC components, eliminating the dependency on shared dlls.
This is a common "missing runtime error" - there are generic check lists below which include this as one source for application launch problems.
Warning: Generally static linking should be avoided in order to benefit from security updates to shared dll files via other update mechanisms.
Short Version: In Visual Studio Installer Projects, check if the Visual C++ Runtime is available in the Prerequisites list.
See this answer, here is a quick screen shot:
Tools: If your project is large you might want to consider another MSI tool. There are many limitations with Visual Studio Installer Projects.
Merge Modules: There are merge modules to install the Visual Studio C++ Runtime, but it is recommended to use the setup.exe for these reasons.
Visual C/C++ Runtime: You are probably just missing the Visual Studio C/C++ Runtime. It needs to be deployed with your application, it is not on there by default (unless you link statically, in which case it should not be needed). Skim this list quickly for other ideas.
You can download the VC++ redistributables at ("The latest supported Visual C++ downloads"):
https://support.microsoft.com/en-us/kb/2977003
More Information:
More on the Visual C/C++ Runtime
Secondary Links:
Detecting presence of Visual C/C++ runtime on box
Missing Dependencies and check lists
Scan for application dependencies
Installing VC++ Runtime with merge modules
i have very old project who has been made in visual studio 2008 with windows xp 32 bit.
I am trying to run this project in windows 7 64 bit with visual studio 2017.
i dont know much details about the project.
i know that MFC MBCS pakage was use.
so now i am trying to compile it and got some compilation errors.
the main one is :
__int64' followed by 'int64' is illegal
in the stdint.h file.
the line that get the error is:
typedef long long int64_d
i check the project and there is no call or use of the stdint header.
i read that it can be because the code build with old version of c++ and now i try to compile with higher version then c++11.
any help will be very appraised.
Thank You!
Well i figure it out.
the problem was that i am using old libs and dlls(probably made by v100 toolset of VS 2010) ,
so i set the platform toolset to the same version of the visual studio that make those
libs and dlls - visual studio 2010 v100.
to do that go to :
right click on the project
properties
configuration properties
general
platform toolset
and set it to v100(or other version needed)
now it's work fine!
When I compile some kind of a project in Visual Studio 2015, does it compile it for 32-bit or 64-bit systems? Is there any way to find out? How do I control which version it compiles between the two?
From the menu bar, you can see the current platform for which the project will be compiled.
If you press the little arrow, you can open the Configuration Manager and create new target platforms.
The Configuration Manager is also available under Build ---> Configuration Manager.
My Development Environment is
C++
Visual Studio 2008
Windows 7
I'm going to start a project (MFC application) and final result (exe) should run on windows xp, vista ,windows 7 or windows 8 without installing any extra packages (like Visual C++ Redistributable package).
Questions:
Which kind of project I should select in visual studio?
What are the project settings I should specify?
You have to use MFC as a static library. Pay attention in project creation wizard for this option.
These are the basic things you have to consider when you start a project in Visual studio that need to run in target computer without installing any other redistribute components.
You have to select project type Win32-> Win32 Console Application or Win32-> Win32 Project as your console or GUI requirements.
You must select No Common Language Runtime support in right click project in solution explorer -> Properties -> General -> Common Language Runtime support
Your application need run-time assemblies to run in target computer. There is two methods to deploy run time DLLs in target computer
Assemblies link statically ( right click project in solution explorer -> Properties -> General -> Use of MFC and Use of ATL). but if your application combine with multiple DLL EXE and LIBs, this method is quite troublesome.
Deploy Runtime DLLs in target computer as private assemblies (I personally recommend this method). More details here
Expanding upon what's already been said..
You need to set the project to build as a static library:
Right click the project
Go to "Properties->Configuration Properties->General->Project Defaults->Use of MFC" set to "Use MFC in a Static Library"
You may also need to turn off the /MD flag if you're using it, and swap it out for '/MT' instead:
Right click the project
Go to "Properties->Configuration Properties->C/C++->Code Generation->Runtime Library" set to "Multi-threaded /MT"
I have an ironpython app that uses dlls.
Some of the dlls written in c#, and one is in managed c++.
The app works fine on my host, and on any host that includes visual studio (2010) installation.
When I tried to run this app on hosts without vs, It failed. After some checking I discovered that ironpython cannot load the c++ dll.
After installing vs - the app runs fine.
I narrowed it down: the dll can be uploaded after the installation of:
-Microsoft application error reporting
-VC 9.0 Runtime(x86)
-VC 10.0 Runtime(x86)
-Microsoft visual studio macro tools
I tried to install Microsoft Visual C++ 2010 Redistributable Package http://www.microsoft.com/download/en/details.aspx?id=5555 and it didn't do the trick.
Why? what exactly happens in installation of vs, that doesn't occur when I install Microsoft Visual C++ 2010 Redistributable Package component?
How can I monitor errors that arise when loading dlls with ipy?
Thank you!
The DLL that is written in managed C++ uses a DLL for its standard libraries. You can change it to static libraries. Follow these steps
Open your project properties in Visual Studio (right click on the project)
Click you way to Configuration Properties > C++ > Code Generation
On the right, find Runtime Library and select Multi-Threaded Debug (/MTd)
Do the same for the Release build, but this time select Multi-Threaded (/MT)
Rebuild all
As for your specific questions :
1. The redistribuable installer will copy the DLL in the system path. Visual Studio will do the same thing. So if it doesn't work, make shure that you have the 32 or 64 bit binaries (same as your code, not the platform you are running). +If you are running from a console, close it and start a new one to get the updated path.
2. Use Dependency Walker. Loading your DLL will show you what it is looking for, it should be enough. To monitor its runtime execution, load IronPython. In the "Profile" menu, select "Start Profiling" and provide a command line that will reproduce your problem.