Skip to content

CodeCoverage with Xcode (Clang): Undefined symbols for architecture x86_64 #84

Description

@carlocorradini

During the linking phase of my GitHub action, I encounter the following errors while using Xcode 14.2 (Clang) (not on Linux/Ubuntu):

[100%] Linking CXX executable [NAME]
Undefined symbols for architecture x86_[64]
  "_llvm_gcda_emit_arcs", referenced from:
      ___llvm_gcov_writeout in [FILE.o]
      ...
  "_llvm_gcda_emit_function", referenced from:
      ___llvm_gcov_writeout in test.[FILE.o]
      ...
  "_llvm_gcda_end_file", referenced from:
      ___llvm_gcov_writeout in in test.[FILE.o]
      ...
  "_llvm_gcda_start_file", referenced from:
      ___llvm_gcov_writeout in in test.[FILE.o]
      ...
  "_llvm_gcda_summary_info", referenced from:
      ___llvm_gcov_writeout in in test.[FILE.o]
      ...
  "_llvm_gcov_init", referenced from:
      ___llvm_gcov_init in in test.[FILE.o]
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like that something is missing during the linking phase (maybe a flag ?).
Any thoughts?
Thanks 🥳

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions