Visual C ++ Default Project

I teach at the Armenian University. I teach "C ++ Programming". During my lecture, I demonstrate and execute on-screen many C ++ programs using the Microsoft IDE (Visual C ++). For many years I used Visual C ++ 6.0. I executed the program by simply double-clicking the .cpp file without creating a project. Visual C ++ 6.0 automatically created a default project. It was very convenient. Now I am using a new version - Visual C ++ 2008 Professional Edition, which does not have this feature. This is not convenient, because I have to create a project for each .cpp file.

My question is: Is there a version of modern Visual C ++ that has this capability? Thank you in advance.

+4
source share
1 answer

I don’t know if any modern versions of visual studio provide this feature, but you can use Premake to create your project

Grab it here

Create a file called premake4.lua containing the following lines

solution "MyApplication" configurations { "Debug", "Release" } -- A project defines one build target project "MyApplication" kind "ConsoleApp" language "C++" files { "**.h", "**.cpp" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "Optimize" } 

Copy premake4.lua inside the source directory, say c: \ lesson1

Then run the following command line inside the same directory

 c:\lesson1> premake4 vs2008 

It will generate a solution and a project containing all the .cpp, .h files in the c: \ lesson1 directory

Hope this helps, feel free to ask me more.

+2
source

Source: https://habr.com/ru/post/1380347/


All Articles