Can't create C++ console application in Visual Studio 2013 - c++

I downloaded Visual Studio 2013 from official site. But I can't create a new console project, as I've seen in some tutorials. The reason is that there is no console application in templates for C++.
May be there is another way to create a new console application?

That's Visual Studio Express for Windows, which is used for Windows Store and Windows Phone apps.
To do Windows desktop apps you need Visual Studio Express for Windows Desktop.
Or, of course, you can use e.g. the MinGW g++ compiler, and some general IDE such as Code::Blocks or Eclipse. But Microsoft's help system is very useful. And currently g++ only supports the Windows API as it was with Windows XP, no newer stuff.

I found a way to create a Console project no matter what version of VS Express you are using.
Create any type of project (i.e. A basic "class library" project).
Right-click the project in Solution Explorer and click Properties. You'll see a dropdown for "Output type". Select "Console Application".
Create a Main method somewhere as an entry point into the app. Doesn't matter what class you put it in.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("We made a console app");
Console.ReadKey();
}
}
I did this with "Visual Studio 2013 Express for Web", so I'm not absolutely certain what your mileage will be on other flavors.

Related

What package should i install to get Win32 console application (Visual Stdio 2019)

My installed or something in my vs 2019 files screen shot
My installed or something in my vs 2019 files widen screen shot
i dont have templates or any win32 console application
pls help me im new to vs 2019
i only coded two applications ( Windows Form Application )
To install other templates, you can open the Visual Studio Installer (open by searching in the windows menu). Choose your VS installation, click more then modify.
Ensure the above option is ticked, then click modify at the bottom.
When you open VS, this is the project type you should make.
.Net Desktop Development
This would help you developing console apps on vs 2019
You could get to vs installer from "Tools>get tools and features"

How to create DLL project in VS2017 correctly?

I use Microsoft Visual Studio 2017 Community Edition and I want to create a C++ dll.library. I use the following manual:
https://msdn.microsoft.com/en-us/en-en/library/ms235636.aspx
However there is no manual for VS 2017, only for 2015 and below. VS 2017 haven't project type Win32 Console Application and it doesn't open Win32 Application Wizard dialog box.
How I can create C++ DLL project in VS2017?
Create the DLL project:
In this set of tasks, you create a project for your DLL, add code, and build it. To begin, start the Visual Studio IDE, and sign in if you need to. The instructions for Visual Studio 2017 version 15.3 come first. Instructions for earlier versions come later, so skip ahead if you need to.
To create a DLL project in Visual Studio 2017 version 15.3 or later
On the menu bar, choose File, New, Project to open the New Project
dialog box.
In the left pane of the New Project dialog box, expand Installed and
Visual C++ if required, and then choose Windows Desktop. In the center pane, select Windows Desktop Wizard. Enter MathLibrary in the
Name box to specify a name for the project.
Choose the OK button to dismiss the New Project dialog and start the
Windows Desktop Project wizard.
In the Windows Desktop Project wizard, under Application type,
select Dynamic Link Library (.dll).
Choose the OK button to create the project.
And To use this .dll in a client app follow this link.

convert Windows Forms Application in C++ to executable file

I am using VS10 C++ and try to convert Windows Forms Application project to executable file: this what I did
select project-> properties -> configuration properties -> C/C++
-> Code Generation -> Runtime library
then I select Multi-threaded Debug(/MTd)
when I built my project I got the following error
A Windows Forms application depends on classes from the .NET Framework Base Class Library. To develop a Windows desktop application in C++ that does NOT depend on .NET, you should use the project template for a Microsoft Foundation Classes (MFC) Application instead. This type of project will compile as a native .exe, instead of a .NET assembly. (By the way, not sure why you would still be using Visual Studio 2010 for C++ development, when the free VS 2015 Community Edition fully supports C++11 and many features of C++14. I do not yet recommend VS 2017 however, since it is still very buggy for C++ development.)
EDIT: In Visual Studio 2017, there is another option (which was not available in VS 2015). If you choose the Windows Desktop Application project template, you will get a project that depends on neither .NET (aka CLR support) nor MFC. I have never tried this approach, but on the surface, it looks very similar to MFC. Again, so far I have found VS 2017 for C++ to be very buggy, so you might have a better experience using MFC in VS 2015 instead.

Win32 Console Application missing in VS2017. How to create C++ Empty Project?

I installed the VS2017 community and I am lost: the Win32 Console Application in missing.
I don't even have template when I go to New Project and also I cannot create C++ Empty Project in VS2017.
How I can solve it?
Install all the optional tools for c++ development
then follow these steps ( Microsoft has updated its visual studio and there are some minor changes)
The new updated changed some things. Win32 Console Application is gone in the new update. Go to File -> New Project -> Visual C++ -> Windows Desktop -> Windows Desktop Wizard -> Application type: Console Application (.exe), Additional Options: Empty Project
Then have fun!
You just need to install "Visual Studio C++ core features". Don't install everything about C++. It consumes too much storage and possibly slow down your IDE.
Steps:
Open Visual Studio 2017 Installer.
Select "Individual Components" tab.
Select "Visual Studio C++ core features".
That's all.
If you are not interested in Game or Mobile C++ development you can remove your selections in "Workloads" tab to get free space in your hard drive :)

Can't change Windows SDK version in Visual Studio C++ project

I have a Visual Studio C++ console application that I created with Visual Studio 2015 and now I can't compile it (with Visual Studio 2017) because it is targeting the Windows 8.1 SDK, which is not installed. The problem is that I can't retarget the project to the Windows 10 SDK.
What happens is that when I open the project properties page and go to General - Target Platform I see the Windows 10 SDK in the dropdown, and I am able to select it... but as soon as I press Apply, it reverts back to 8.1 by itself. No error message is provided.
Visual Studio installer says that, indeed, the listed SDK version is installed:
So what's going on here? Is there a way to retarget my project without having to install the Windows 8.1 SDK?
Not sure if that matters but: this project is actually just a "wrapper" around an existing bare project consisting of just a bunch of .cpp and .h files, which was developed by another person. I'm really not familiar with C++ development.
After hours of struggling with this problem, I coincidentally discovered that selecting Project Properties/General, changing "Platform Toolset" to v141_xp (instead of v141) forcibly drops the Windows SDK Version to 8.1 or 7.0. I'm not sure how Visual Studio chooses which SDK to use.
EDIT: You must edit .vcxproj and change both:
<TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>