Configure a Visual C++ 2010 project to use include folder as in Linux - visual-c++

I'm porting a Linux C project in Visual Studio 2010.
I have the following folder project structure under linux:
ProjectName->Src->Source C files
ProjectName->Header->Source H files related to C
How should I configure Visual Studio 2010 to recreate the same structure without compile errors ?
How to create the include folder and tell to the the compiler that is an include folder.
I cannot even add include files (existing elements) in a simple folder. They simply don't appear as I add it.

On the C/C++ configuration tab is the Additional Include Directories option. Set it to the following:
$(ProjectDir)/Header
That should do it. Don't forget to do it for all your configs (debug, release, etc).
Oh, and regarding adding new header files, when you open the Add.. option to add a new file, pay close attention to the BOTTOM of the dialog. it will tell you where it will be placed, and you can change it there.

Related

How to inspect an external .cpp file?

I have in the project a cpp file that is outside the dir tree. Resharper c++ doesn't enable inspection, such as go to definition.
Resharper version 2022.1.2
Visual studio 2019 and 2022
It didn't help enabling
options> code editing> c++> inspection> enable on external modules
Also, it's not an external file, it's a cpp that is part of the project.
There's also this
https://www.jetbrains.com/help/resharper/Reference__Options__Tools__External_Sources.html
but the option doesn't appear under tools.
The problem is with resharper; VS inspection (go to definition) works fine.
I found the problem, and it's weird. Say I want to add to the project the file:
c:\prj\confstruct\src\debug\mpir.cpp
which is outside the project directory.
If in cmake I use the abs path (given as a parameter to add_executable):
/prj/confstruct/src/debug/mpir.cpp
then resharper ignores the file.
If I add the drive letter:
c:/prj/confstruct/src/debug/mpir.cpp
Then resharper works fine.
Make sure that the file is used somewhere in your project, i.e. is included into one of your .cpp files. Turn on the "Enable inspections, quick fixes and context actions in files external to the solution" option in ReSharper settings:

No VC/inc folder in my MSVS 2013 directory

I'm trying to add FLTK to MSVS 2013 and I'm copying the .lib files into vc/inc but I cannot find the folder anywhere. Under the Visual Studio 2013 folder all I have is
ArchitectureExplorer, Backup Files, Code Snippets,
Projects, Settings, StartPages, Templates, Visualizers
What am I missing here? I'm sure its something stupid.
Not exactly sure what you mean by holder. Start VS, select Tools/Options/Projects & Solutions/VC++ directories.
On the right pane, select Include files from the top right box and add your FLTK include directory in the listbox below.
Then select Library files from the top right box and add your FLTK library directory to the listbox below.
That's basically it - there is no need to copy files anywhere.

Change where Visual Studio default settings on startup?

I like to keep my folders quite organised, and don't like the default Visual Studio folder in my documents. It seems like it should be rather simple to point VS to my own custom folders for most of its settings, which I have done. The only problem is, on start up, VS keeps looking for a settings file (*.vssettings file) in a (non-existent) default folder which I can't seem to find any option to change (c:\users\renzo\documents\visual studio 2013\settings), making the IDE revert to most recent settings (the custom settings file I have created in a nice separate folder... which is fine, but accompanied by an annoying error message). If I so much as touch the tools-options menu (literally, without changing anything) VS then creates a new folder (in that same annoying default location!) storing my current settings! The cycle repeats!
Is there anyway to change where VS looks for these default *.vssettings files, and stop creating this new irritating "CurrentSettings.vssettings" file!?
Might seem a bit nit-picky, but its really getting under my skin!
Thanks,
Renzo
Use mklink to change directory or file location to what you want. Choose one of the commands below.
mklink /d d:\VisualStudio c:\users\renzo\documents\visual studio 2013
mklink /d d:\VisualStudioSettings c:\users\renzo\documents\visual studio 2013\settings
mklink d:\VisualStudioSettings\CurrentSettings.vssettings "d:\VisualStudioSettings c:\users\renzo\documents\visual studio 2013\settings\CurrentSettings.vssettings"

Visual Studio: Exclude From Project Quickly

I have got thousands of files/folders inside a solution. For some reason I have to exclude them all and then include again in the project, to get the latest list of files.
The normal "Exclude From Project" in visual studio menu takes too much time. Is there a quick way to do it?
Thanks!
Put them all into one master folder and include that folder.
If some are files, you may also want to compile them and include the DLLs or the equivalent in whatever language you're using.

Visual studio - set file location

I have a VS project, but I moved some source, resource files to another location.
It's not easy for me to readd all again (cause of filled properties tab for custom build tools, etc.)
Is there any easy GUI way to change the included source file path? In XCode it's easy to do this, but I don't see any way in Visual Studio (currently using 2012).
Do I have to rewrite the xml build file?
I have finally find it. Easiest way is to edit the xml file .vcxproj. I just have to manually find the paths (they are relative... i dont really know why Microsoft did this, it is so stupid) in that xml and edit it.

Resources