Beginner Problem: Static Linking on Xcode

19 Views Asked by At

I just started practicing Static Linking, and I tried to link a third party library into my code, but it kept bugging error: "The header file not found", so I believe there're some steps missing from my code.

Here is the situation: I use OpenGL as the target library, it contains two directories: "Include" directory which holds header files and "lib-arm64"directory which holds "libglfw3.a" and "libglfw.3.dylib". I believe .dylib is related to dynamic linking, so I am not gonna touch that and .a file is the source code I need. Therefore:

  1. In Build Phase -> Linking Binary with Library, I attach "libglfw3.a".
  2. In Build Setting -> Search Path, I include the address of header directory "Include" in "Header Search Path" and "lib-arm64" in "Library Search Path".
  3. #include <GLFW/glfw3.h> is the command I copied from OpenGL website template and used in my code.

The error is: GLFW/glfw3.h' file not found

If anyone has any advice, feel free to share it, I really appreciate!

0

There are 0 best solutions below