Visual Studio - how to chain build of projects with different bitness [duplicate] - c++

This question already has an answer here:
Sequentially build configurations in Visual Studio without MSBuild or plugins?
(1 answer)
Closed 6 years ago.
I have a C++ solution with several projects, for example A and B.
In build process I need several sequential steps:
A x32
A x64
B x32
This needed because results of A x32 and A x64 used in pre-build event of B x32.
It's easy to force Visual Studio compile A x32 before B x32 - just add A to B's dependencies. But how we can force Visual Studio to compile A x64 before B x32?
I use Visual Studio 2015

Visual Studio has a "Batch Build" option. Build -> Batch Build. This will support building multiple configurations. Which, as I understand your question, is what you want.
Here is the MS link.
I don't think you can add this permanently to the solution/project configuration.

Related

Release C++ code using Visual Studio 2017 [duplicate]

This question already has answers here:
Visual Studio 2017 C++ Exe for any pc (linking vcruntime140.dll)
(2 answers)
Closed 2 years ago.
I have written a C++ project using Visual Studio 2017 in Windows 10. I am trying to run the code in other computers as well.
So, I tried copying the Release folder to another Windows 10 computer. But, when I try to execute the .exe file, it is showing errors: missing dll’s: vcruntime140.dll and ucrtbased.dll.
Please help me in the release process to be followed.
The reason is because your application is dynamically loading the VC runtime which gets installed with the Redistributable package. Typically people can install the Redistributable packages without the full SDK but the easier solution is to just compile your application to statically load the C runtime libraries.
Go to project settings, then C/C++->Code generataion and change your runtime library from /MD to /MT. /MD is dynamic and /MT is static.
Also you can just install the package on your other machine from here https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

How to build C++ project in Visual Studio 2015 and Visual Studio 2002 at one time

I need to build my C++ projects in two environments:
Visual Studio 2015 (VS2015) installed on Windows 10 x64
Visual Studio 2002 (VS2002) installed on Windows XP
Now every time I need to trigger to build my projects twice on 2 PC and this way is not sufficient for me.
I do some research before and someone suggest to install multiple compiler in one PC, but the problem is that VS2002 is too old to be installed on Windows 10 x64.
I am looking for any method or software tool that I can trigger the build once then I can build my projects on both VS2015 and VS2002 (e.g. if I can install both VS2015 and VS2002 in one PC, I can write a simple batch file to build my project in both compiler).
EDIT:
This answer is outdated because of clarification that the software is installed on two physically different machines.
If you have both VS .NET 2002 and VS2015 installed then you already have two compilers installed and they will be installed in two different places. You then should just be able to write a batch file to call each version of cl.exe (making sure the paths are absolute) and compile/link/build each project.

how/where to grab compiler of msvs 2008 (32bit) compiler toolchain without installing msvs2008 [duplicate]

This question already has answers here:
download and install visual studio 2008 [closed]
(6 answers)
Closed 5 years ago.
I'm relatively new-comer to developing in windows ("7") and the environment that has been set up for me is using as IDE MS Visual Studio 2015. For a new project I'll be involved in I will work with a team who have been developing in Visual Studio 2008 a 32bit application.
As I try to create the development environment using cmake and selecting as target compiler "Visual Studio 9 2008" , cmake whines that
CMake Error at CMakeLists.txt:10 (project):
No CMAKE_CXX_COMPILER could be found.
CMake Error at CMakeLists.txt:10 (project):
No CMAKE_C_COMPILER could be found.
So I would need to obtain the respective toolchain. I have no idea how to do that in windows though and google (at least with the search terms I have used) has not been very helpful.
Note: The IDE of the team is indeed old but it is not an option to ask all of them to migrate now to a newer version.
Note2: As I understand, I cannot obtain a license for "Visual Studio 2008" anymore, but even if this is not the case, I would prefer to continue using visual studio 2015 even while developing this project. Is it possible to just obtain the compiler toolchain of 2008 and integrate it somehow so that
1) cmake can find it
2) visual studio 2015 can use it
Easiest way to go would be to install Visual studio 2008 Express if you can find the installer. It is free, and you can use its compiler without using the IDE.
In cmake you can separately select target IDE version (generator) and target compilers (toolchain).
AFAIK there was no separate download just for the compilers but there were some bundles which include it and you can try your luck with them if you can't/don't want to install full VS2008 installation (cmake might have some difficulties finding this versions though).
"Microsoft Visual C++ Compiler for Python 2.7" package should contain just the compiler/libraries part of the VS 2008
"Windows SDK 6.1" and "Windows SDK 7.0" (but not "Windows SDK 7.1") include a version of the compiler which should be compatible with VS2008

How to run a C++ application built in Visual Studio 2015 on another machine [duplicate]

This question already has answers here:
using static libraries instead of dynamic libraries in opencv
(5 answers)
Closed 6 years ago.
I have been developing some programs in C++ using Open CV on Visual Studio 2015 and am trying to run the executable produced from building Visual Studio on another machine, but on the new machine it informs me that multiple .dll files are missing. Is there such a way to compile it in Visual Studio that it will not require these .dll files, or is there a way to have all of the .dll files on the new machine?
I am running in x86 Release and have changed the C / C++ code generation to just Multi Threaded.
The Open CV I have installed is 3.0, does this cause issues with using Visual Studio 2015?
Cheers
You need to install the Visual Studio redistributables on the machine where the application is going to run : http://www.microsoft.com/en-us/download/details.aspx?id=48145
Either have your installer install the redist. Ask the user to do it. Or bundle the libraries manually with your executable.

How can I configure visual c++ 2008 for 64 bit? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to compile a 64-bit application using Visual C++ 2010 Express?
How can I compile 64 bit with visual c++ 2008
I am trying to compile an application that contains CUDA code. I have visual c++ 2008 express version (the free version) on my computer. To be able to use the cuda compiler I followed the steps from here, here and here. The cuda files (with *.cu extension) now compile fine, but the other normal C++ files are using 32 bit because at the drop box on the top (configuration manager) of IDE, it says Win32. There is no option to make it Win64. What should I do to tell configuration manager to use 64 bit. Note that I have 64 bit compilation tools now that I installed the Windows SDK.
Visual Studio Express 2008 doesn't ship with the x64 compiler, that's reserved for the pro versions.
The command-line version is included in the Windows SDK though, which is available for free. You can find some information about adding the 64bit compiler to Visual Studio Express on the internet, but it's a big hack. Just a quick search on google revealed for example this blog-entry: https://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/
http://msdn.microsoft.com/en-us/library/9yb4317s%28v=vs.90%29.aspx
"64-bit tools are not available on Visual C++ Express by default. To enable 64-bit tools on Visual C++ Express, install the Windows Software Development Kit (SDK) in addition to Visual C++ Express. Otherwise, an error occurs when you attempt to configure a project to target a 64-bit platform using Visual C++ Express."
Right click the solution -> Active solution platform -> New... -> x64 (under "Type or select the new platform:)