0

The Question

In Visual Studio, in the "Configuration Manager" under the Build tab, there is an option called the "Active Solution Platform." This causes problems with one of my commonly used libraries. Is there a way to set this to default to x64? Is there a way to have this setting set when I load a custom project template?

Extra Details

I recently installed mlpack on Windows 10 using

vcpkg install mlpack:x64-windows

I then wrote a sample mlpack project in Visual Studio and did the work to compile it. That required overcoming the error:

fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

To do that, I followed step 1 and 2 from this question.

After the project compiled, I exported it as a project template so I could build my next project faster. I started a new solution with the project template. I tried to compile the project, and I ran into error

fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

The problem was that the Build Configuration settings weren't saved with the project template. (See step 2 in the link above.) The "Active Solution Platform" in the Build Configuration menu defaulted to x86, despite that the Project's "Target Machine" (and the machine I am building on) are x64. This leads me to the question above.

user589321
  • 99
  • 6
  • Does this answer your question? [MSVS: How can I set the x64 as the default, instead of AnyCPU?](https://stackoverflow.com/questions/28882582/msvs-how-can-i-set-the-x64-as-the-default-instead-of-anycpu) – ChrisMM Mar 28 '22 at 22:21
  • @ChrisMM no it doesn't. That is about the project configuration. The Active Solution Platform is a different setting, and the x86 option is already labelled x86. The Active Solution Platform determines the default Project platform, not alphabetical order. – user589321 Mar 28 '22 at 22:49
  • What project did you create, console or win32? And the version of Visual Studio? – Minxin Yu - MSFT Mar 29 '22 at 01:42

1 Answers1

0

Try to create the project in Visual Studio 2022. C++ uses x64 as Active solution platform by default in VS2022.

Minxin Yu - MSFT
  • 2,234
  • 1
  • 3
  • 14