VS c++ Additional Include directories - visual-studio-2010

fatal error C1083: Cannot open include file: 'header.h': No such file or directory
What is the correct syntax for locating the path?
Is it \\Main_folder\include\ ?

See Macros for build commands and properties, or click the 'edit' button and choose 'Macros', to see the correct way to address paths within your project or solution.
For Main_Folder\Include you probably want $(SolutionDir)Include or $(ProjectDir)Include.

Related

Visual studio wrong file path for Form1.cs file

I am trying to open a project which was created on one computer but has since been moved to another one due to the computer going caput. Now when I open the project and try opening the Form1.cs file, or any of the designer files, I get the error message saying "Cannot find the file 'C:...\Form1.cs'. It may have been moved or deleted". I have omitted the full path which is a reference to the old computer.
How do I change the file path so that my project can find it?
I have found another thread on this issue: Visual Studio retrieving an incorrect path to a project from somewhere
Have tried all of the suggestions (deleting .suo files, moving the project to a new folder, etc.) Nothing has worked so far. There is however in the accepted solution a reference to "Manage Workspaces" and "Source Control Explorer", which I literally can't even find in my Visual Studio window.
Help please!
Alexander
First: Open your sln file and see where it says your csproj file is located. It should read something like: "WindowsFormsApp1\WindowsFormsApp1.csproj"
Note: Everything in the parenthesis will be from the same directory as the sln file, so the true directory in this instance will be "sln_file_path\WindowsFormsApp1\WindowsFormsApp1.csproj"
As long as this is correct, then navigate to the csproj file and open it with notepad, but if this path is wrong, correct it before proceeding.
Second: Search the csproj file for the missing file, which in your case is Form1.cs
You should find something like: Compile Include="....\Erroneous_Directory\Form1.cs"
Typically all cs files will be in the same directory as the csproj file, so the line should simply read as follows: Compile Include="Form1.cs"
If the file is legitimately located in a separate directory, then provide the path, but if it is in the same directory, delete the path. Sometimes, when linking to a file in a different project, you will see this: (Link)Form1.cs(/Link), but if the file is in the same project and directory, this link line will need to be deleted.
Note: Chances are that this procedure will need to be repeated for two other files: Form1.Designer.cs and Form1.resx as well, so make sure the "Compile Include" lines for these two files are also correct before opening the solution

Making local project items accessible from the shared projects in VS C++ 2017

I have deb_sets.h in the main project to set debugging options for the whole project.
Shared projects include this file too. However, it will be different in different main projects.
I get a compilation error fatal error: deb_sets.h: No such file or directory in every shared project file which include this file.
Is my idea possible to achieve?
You need to add the #include "deb_sets.h" in all source files that use this header, but if this header file is in another directory, you need to change "Additional Include Directories" (C++\General section) in the project options to set the header file path.

fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-gd-1_53.lib' - file ignored, no matter what i link

I have just bjamed boost and it seems like its still gonna refuse to work (I alread have tried and given up to make this library). What I did was, that I launched bjam.exe and I linked:
include directories: C:\ ... \boost_1_53_0
Library directories: C:\ ... \boost_1_53_0\bin.v2\libs
But I still get the error. So I decided to look in the folders, and this showed up to be path to the desired library:
C:\ ... \boost_1_53_0\bin.v2\libs\date_time\build\msvc-10.0\debug\link-static\threading-multi\
If I explicitly add this folder to the Library directories, the library is found but in VCC another error pops up, asking me for another library.
So how do I ask bjam to make a folder system that VCC can understand?
Adding the C:...\boost_1_55_0\stage\lib directory worked for me. Added to:
Project properties -> Configuration Properties -> VC++ Directories -> Library Directories.
Adding the following link to 'Configuration properties -> Linker -> General -> Additional Library Directories ' helped me as well.
'C:\Program Files\boost\boost_1_55_0\stage\lib'

NVIDIA SDK is missing a header file

I am writing a simple program and trying to include this file in my code #include <cutil_inline.h> but I am getting an error..
fatal error C1083: Cannot open include file: 'cutil_inline.h': No such file or directory
I have tried this but still getting the error
Error:
fatal error C1083: Cannot open include file: 'cutil_inline.h': No such file or directory
Solution:
1- right-click on project name in solution explorer window
2- Click "Properties"
3- in left window Click Configuration Properties -> Linker
4- set the value of "Additional Library Directories" to
"$(CUDA_PATH)/lib/$(PlatformName)";"$(NVSDKCOMPUTE_ROOT)/C/common/lib"
5- Right-click on your .cu file
6- Click Properties
7- Click on Cuda Runtime API
8- Set Additional Include Directories to :
$(CUDA_PATH)/include;./;$(NVSDKCOMPUTE_ROOT)/C/common/inc;$(NVSDKCOMPUTE_ROOT)/shared/inc
Can anybody help me out here. ?
Note you are missing a header, not a library. Making changes in Additional Library Directories will not help you.
Find the path cutil_inline.h is in. Make sure your SDK version includes it; if it doesn't, see if your code can do without it. Also note that according to the comment from #talonmies, the cutil package doesn't exist in CUDA 5.
Put the path into Configuration Properties -> C/C++ -> General -> Additional Include Directories.
For me it's under $(NVSDKCUDA_ROOT)\common\inc, but your mileage may vary.

Builds with command line "devenv" but not with Visual Studio (sln) and MSBUild

I'm trying to set up a project with TeamCity and I was wondering what does exactly happen when I choose “Visual Studio (sln)” from the drop down menu under "Runner Type". When I choose this option my project fails to build and I get a bunch of compilation errors like this :
Logging\LoggingSingleton.cpp(19, 0): error C1083: Cannot open include
file: 'Auto/AutoHandle.h': No such file or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\auto\AutoTempFile.h(16,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\auto\AutoTempFolder.h(23,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\logging\McLog2.h(8,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\encryption\McAfeeObfuscation.h(2,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\BaseIniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\IniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\BaseIniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
d:\tcbuildagent\work\b1f06d91677fef59\consumer_2011_050\coretech\sdk\src\file\BaseIniReader.h(21,
0): error C1083: Cannot open include file: 'Coretech.h': No such file
or directory
However, if I choose “Command Line” as my runner type, and run my solution like : devenv ………../LogReader.sln /Build “Debug” it builds fine with no compilation error. But we don’t want our teams to manually put in the parameters every time, and either build it with MSBuild (gives same errors as Visual Studio sln) or “Visual Studio (sln)”.
You might verify the platform that it is building with, or specify it. We've had similar issues in the past when the project settings were inconsistent across platform, and the platform being built was not the one that was expected. In this case, I would suspect that one platform does not have the same include directories as another.
TeamCity is a build server which has a set of plugin support to perform the more than one type of build process in a very smoother fashion. TeamCity downloads the code from the Source Control application to a working folder and starts the build process. The build process expects the assembly references and libraries as similar to a developer machine. For example, a basic .net application requies the appropriate .net framework to perform the build process. Similarly in your case, the libraries. If you can make the library files available, the build process will run without an issue.

Resources