CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: [RESOLVED] "Cannot Open Source File" that is definitely there

  1. #1
    Join Date
    Apr 2018

    [RESOLVED] "Cannot Open Source File" that is definitely there

    I'm going up the wall with this one. I'm trying to include a certain library, but VS2017 insists it can't find the header file. It's been a long time since I've used Visual Studio or C++, but I was able to include another library by following these same steps, so I feel silly that I can't do it again!

    For context's sake, I'm trying to work with the DragonBones/SFML library. The header file is "DragonBonesHeaders.h," and is included in a folder called "dragonBones" by default. The include statements reference it by its subfolder, #include <dragonBones/DragonBonesHeaders.h>.

    First, I set up the project with an Additional Include Directory to the DragonBones include directory, using a relative path. Failure. I try an absolute path - zilch. Then, I get annoyed at how many folders the snapshot dubbed "dragonBones" by default (four and a half), so I start renaming folders just to make sure the identical names aren't causing the problem. The include statements now read: #include <dragonBonesCore/DragonBonesHeaders.h>. Nothing. Then, I tried to get rid of the subfolder problem entirely by adding dragonBonesCore to my Additional Include Directories and changing the include statements to #include <DragonBonesHeaders.h>. Nope!

    This is getting so silly that I don't even know if I can trust copy and paste. Here are some screenshots instead, so you can see the exact content.

    Additional Include Directories for the project in question:

    The folder containing the file, with its directory structure visible:

    The original #include statement, using my renamed folder:

    The errors:

    The modified #include statement, linking directly to the containing folder:

    The error:

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    Re: "Cannot Open Source File" that is definitely there

    Did you try to
    #include "DragonBonesHeaders.h"
    Last edited by VictorN; April 6th, 2018 at 10:05 AM. Reason: typos corrected (it must be quotation mark instead of apostrophe!)
    Victor Nijegorodov

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012

    Re: "Cannot Open Source File" that is definitely there

    Failure. I try an absolute path - zilch.
    If the absolute path was correct, this may indicate a problem with the include file itself - or it's permissions. Have you tried

    #include "full-absolute-complete-header-file-name"
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2017 (15.9.9)

  4. #4
    Join Date
    Apr 2018

    Re: "Cannot Open Source File" that is definitely there

    Hi again, and thanks to both of you. But guess what happened? I woke my computer from Sleep, hit "Rebuild" even though I hadn't changed anything, and it was just... working. I don't even know what to say. This is yet another reminder that computers are secretly demon magic.

    Hopefully if someone else is suffering a similar problem, your advice will help them find it! In the meantime, you can consider my question closed. Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)