How to save default startup project in visual studio - c++

What information does visual studio look at when determining the start-up project?
I have a C++ visual studio solution with 2 projects. My source control is messed up so I have to copy my solution folder from the repository to my local disk. When I do this and I run my application, the wrong project is set as the start-up project. In the repository I check in the .sln and .vcproj file as well as the cpp/h files, but not the .suo or .user files.

Visual Studio: Where does it store "Set as startup project"?
The startup project is stored in the .suo. As mentioned in that SO post, you should not check these in, because they are not portable across machines/directories.

Related

How do I rename a Qt Visual studio project?

I want to rename my Qt Visual studio project. I tried renaming the project folder and the vcxproj files. I replaced all the instances of the old project name inside the vcxproj files manually. I also replaced all the instances of the old project name inside the qrc files. I have done this before with other non-Qt visual studio projects, and it has worked successfully. However, with this project I am getting the following error.
MSB4181: the "QtRunWork" task returned false but did not log an error. (qt_globals.target 293)
Can someone please tell me how to fix this?

make visual studio add all necessary when building release

So I am working on an example project that displays video from a network stream.
The project is in C++.
After building the project in release, and trying to run the project on a different computer, I get errors on missing DLL files.
These DLL files are located within the installation location of Visual studio.
one example is msvcp140d.dll.
After copying all the missing files, I get a generic error with no specific file.
So:
Is there a way to tell visual studio to add all relevant files when building the project?

How to change the working directory in visual studio for c++

Usually, I place all the assets I need in the project folder, and whenever I run it using the Visual Studio debugger, it runs fine. But when I run the .exe file using the command line, or by just clicking on it, it has problems loading the files. The only way it can load the files is if copy all the resource files in the folder that my .exe application resides in. How could change where Visual Studio looks for the resource files when I run it using the Visual Studio Debugger so that it looks in the folder with the .exe in it, and not the project folder for all configurations (i.e. Debug and Release).
If I understand correctly you would like to move application dependencies into the Debug or Release folder.
You can do it using project property page (right click on the project and select properties). From list on the left side, select build events. There are three options, you can use Post-Build.
Have a look here : Visual Studio Post Build Event - Copy to Relative Directory Location

How to produce platform independent source files (which can generate project files for anyone using cmake) from a visual studio solution?

I know cmake is a tool which can produce visual studio solution files from source files. I see many of c++ projects are stored in the github in that way. My problem is how create that source. Is there anyway to generate it on visual studio or anyother way.? I have created a project by using visual studio . So I have the solution file. I want to upload it in to github as a portable source which can produce project files later using cmake for anyone.

How do I debug existing C++ source code in Visual Studio 2015?

This may have a very simple solution, but being new to Visual Studio and C++ programming, I'm having a hard time with this.
I downloaded an SDK written in C++ which contains an executable file and also the source and header files. The executable file accepts some command line arguments. So far I've been running the executable file from the windows command prompt (like C:\path\filename.exe -argument), but now I want to be able to enter these command line arguments and then place breakpoints in the source code for debugging the source code.
I don't know how I can open the source files in Visual Studio and debug it. If I just open the source file with the main function, the debug button says 'Attach' on it instead of debug.
I see another similar question here, but that question is for a project developed using Visual Studio whereas the source code I have does not have any Visual Studio project/solution files. The only files I have are the executable, the source and header files (.cpp, .h, .hpp), and CMakeLists.txt files.
You can "open" the exe as a project (you can achieve the same if you drag and drop the exe into VS icon). Then you can add command line parameters at Project Properties. You will need to have debug symbol information (usually a .pdb file), if you want source code level debugging (values of variables, etc.). If you don't have that, you can only debug at the disassembly level.
You may want to create a proper project for the source files - it is an easy task, if the project is simple - so you can rebuild the exe.