Saturday, March 20, 2021

Visual Studio can't 'see' my included header files

  1. VISUAL STUDIO ISSUE MOST LIKELY - CAN'T SEE INCLUDE FILE
  2. A Question: Using Microsoft Visual Studio 2015 fortran code runs fine and an INCLUDE file is picked up and found just fine. Same code including have gone through ALL the preprocessor options running in Microsoft Visual Studio 2017 yields an inability for the INCLUDE file to be read. Assumption that this is a Visual Studio issue as nothing changed with the FORTRAN. I post here in the event that anyone else has seen this problem?

    A Good Anwser: There are two places for specifying INCLUDE directories. The one you found applies to all compiles across all projects. Typically this is used only for "system" type INCLUDE files, but if you have a set of files that you use a lot, that's a fine place to set them.

    The other is in the Project properties - there are two property pages that have "Additional Include Directories" properties: General and Preprocessor. They are the same (set one and the other changes.) This affects that project only. Note that project properties, by default, are specific to the Configuration (Debug/Release) and Platform (Win32/x64). If you want to set it for all of one or both, you have to specify "All Configurations"and/ or "All Platforms". If you are using module files, which are also found using these paths, you probably won't want to use "All Platforms" since .mod files are platform-specific.

    The default for INCLUDE files is the directory where the source file that had the INCLUDE statement is located. (Controlled by /assume:source_include). If the compiler doesn't find it there, it will look in the project's "additional" directories first and then the ones you set under Tools. Note that the latter is also platform-specific.

    The VS version has no real effect on program execution time. The only possible connection I could think of is the different MSVC libraries, but I have yet to see where those make a measurable difference.

  3. Visual Studio can't 'see' my included header files
  4. A Question:I created an empty 'Demo' project in Visual Studio 2008 and added some existing projects to my solution. Included "MyHeader.h" (other project's header) in main.cpp file which is in 'Demo'. Also added header files' path in "Tools/Option/VC++ Directories/Include files" section. But intellisense says: "File 'MyHeader.h' not found in current source file's directory or in build system paths..."

    How the problem can be fixed? Thanks.

    A Solution: If you choose Project and then All Files in the menu, all files should be displayed in the Solution Explorer that are physically in your project map, but not (yet) included in your project. If you right click on the file you want to add in the Solution Explorer, you can include it.

    If you choose Project and then All Files in the menu, all files should be displayed in the Solution Explorer that are physically in your project map, but not (yet) included in your project. If you right click on the file you want to add in the Solution Explorer, you can include it.

    Delete the .sdf file that is in your solution directory. It's just the Intellisense database, and Visual Studio will recreate it the next time you open that solution. This db can get corrupted and cause the IDE to not be able to find things, and since the compiler generates this information for itself on the fly, it wouldn't be affected.

    In Visual Studio 2019 in my case I copied a header file into the project directory, just near the other files. Intellisense could see it, but the build failed. Fair enough, it wasn't actually added to the project. I added it as existing item but this is the point that Visual Studio still didn't account for it. Solution:

    1. Close the project.
    2. Delete the .vs directory.
    3. Reopen the project. Now Visual Studio recreates the directory with everything in it and it can now see the included file.

  5. Visual Studio 2017 can't see include files and folders
  6. It could be failing because you are building in "Release" mode and you have added the path in "Debug" configuration. If you have made the same configuration changes in "Release" too, create a sample project, upload and provide the link to take a look at that. .

  7. /I (Additional include directories)
  8. Adds a directory to the list of directories searched for include files.

  9. Can not include header files
  10. I have just downloaded Open Frameworks for VisualStudio and im able to do simple things like drawing shapes on the screen etc. The problem is that i dont know how to add my own class. If i add a class consisting of header and .cpp file to “src” directory Im unable to #include header file in “main.cpp”. I dont understand why its like this, “main.cpp” and my class are in the same exact directory and VisualStudio is telling me that there is no header file named like this.

  11. VisualStudio cannot find include files
  12. It is obvious that I am missing something, but VisualStudio 2005 can’t seem to find my project’s include files, even though I have generated the project with the Introjucer (JuceLibraryCode.cpp compile fine). The projects work fine on the Mac. My source files each include the JuceHeader.h and/or other headers that belong to the project:.

No comments:

Post a Comment