Sunday, February 06, 2022

[Solved] 15 duplicate symbols for architecture x86_64


Error:

If you are getting build failures in Xcode for a C++ program with similar errors, then try this fix.

15 duplicate symbols for architecture x86_64

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


Solution:
  • You can avoid declaring variables in the header and move them to implementation.
  • Or you can declare all the variables in the header file as static.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.