.h file not found

前端 未结 13 2076
清酒与你
清酒与你 2020-12-07 23:56

I\'m working on an app in xcode 4 and everything was going great, then something odd just started happening. Every time I make a new class (any type of class, ViewController

相关标签:
13条回答
  • 2020-12-08 00:49

    Must be an issue with the software... after quitting xcode and the simulator a few times, it works again. I didn't change a thing. But now autocompletion stopped working! Que sera sera.

    0 讨论(0)
  • 2020-12-08 00:51

    I encounter the same problem and the following steps fix my issues:

    1. Go to the target of project.
    2. Go the the "Build Phases"
    3. Expand the "Compile Sources"
    4. delete the [filename that cause the error].m
    5. Add the file back.
    6. Scroll down, in Build Phases, to "Headers (n items)" and add the .h file in the "Public/Private" section
    0 讨论(0)
  • 2020-12-08 00:53

    In Build Settings... changing C++ Standard library from libstd++ (GNU C++) to libc++ (LLVM) worked for me!!

    0 讨论(0)
  • 2020-12-08 00:56

    My issue was I added the MetalPetal pod and I couldn't access the "MTIShaderLib.h" header to build custom filters even though the header was declared as public. I tried everything above and more and more and more from other answers but the problem was listed in the directions for the pod installation that I overlooked.

    What I had to do was go to my main applications icon (the blue icon), select Build Settings, then in the search box I typed in header search paths.

    Under Metal Compiler - Build Options I went to Header Search Paths and pressed the arrow.

    I clicked Debug and in the pop up box I pressed the + sign at the bottom and entered:

    ${PODS_CONFIGURATION_BUILD_DIR}/MetalPetal/MetalPetal.framework/Headers

    I then did the same exact thing for Release. Make sure you do the steps for both Debug and Release

    Problem was resolved after many frustrating hours.

    0 讨论(0)
  • 2020-12-08 00:59

    maybe you're using #import "something.h" instead of #import ('<>' used for framework files)

    0 讨论(0)
  • 2020-12-08 01:00

    For me, it turned out to be the setting for relative path. When I changed location setting from "Relative to Group" to "Relative to Project", suddenly the header file was found. I noticed in the log that the path where it was looking was incorrect, it didn't seem to traverse the directory tree correctly, which lead me to try the other relative settings.

    enter image description here

    0 讨论(0)
提交回复
热议问题