Post

Replies

Boosts

Views

Activity

Beginner Problem: Static Linking
Hi, 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, wish someone can help! 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: In Build Phase -> Linking Binary with Library, I attach "libglfw3.a". In Build Setting -> Search Path, I include the address of header directory "Include" in "Header Search Path" and "lib-arm64" in "Library Search Path". "#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! Another question I have, non-relevant to linking, but to debugging.
3
0
1.1k
Dec ’23
Beginner Debug Problem
Hi, I am trying to use debugging in Xcode, specifically "edit breakpoint" part. So I have loop:" for(int i = 0 ; i < 10; ++i){ } return 0; " And I set a breakpoint inside the loop, then I edit the breakpoint condition: "i>5" and log message: The current value for I is: $i The error I got: "use of undeclared identifier 'i' Could anybody help me solve the error? Thank you!
1
0
544
Dec ’23