简体   繁体   中英

Visual Studio 2010 2 projects in 1 solution

I have Console version of app, developed earlier and want to have MFC visualization of it, but with ability to run Console version too. Is it possible to add new project next to existing Console project in the same solution? Also, I have to link libraries statically.

Yes absolutely it is possible, that is what a Solution file is for. All you have to do is right click in the Solution Explorer and add a new project, the solution file will be created for you.

If you do have multiple projects, you can also specify to start more than one of them when you want to debug, just right click on the solution in Solution Explorer->Properties, Common Properties->Startup Project, then select the Multiple Startup Projects radio button.

Yes, you can have many projects in one solution. Not sure, that you can reference exe file as library for MFC project. For CLI project, yes - you can do that.

Yes you can - add a new project and add files to it. You don't have to link statically, you can link exactly as you want. In fact, you can also copy the old project file edit its contents to rename it and add that to the solution and then remove/add particular files you want.

Its not like C# where you have to mirror the on-disc layout of your project files, C++ files can be referenced where-ever you like.

An alternative would be to add a new build target (eg debug, release, and add 'console - debug' and 'console - release'), then you can mark files as excluded from the builds based on their target, so you can have 1 project that builds 2 slightly different versions of your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM