Undefined symbols for architecture x86_64: on a MacBook M2.

Answered

Hello!

I’m working on a C project with a binary tree structure and encountering a linker error when attempting to build the project. The build process successfully compiles individual files but fails during the linking stage. The error message indicates that there are "undefined symbols" for a specific architecture, and certain symbols are not found for that architecture. 

The error is: 

Undefined symbols for architecture x86_64

functions…

ld: symbol(s) not found for architecture x86_64
cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Any insights into why this linking issue is occurring or how can I resolve it?

Thank you!

0
1 comment

Hello!

If it's a CMake project, please try deleting the cmake-build-*** directory, executing Tools | CMake | Reset Cache and Reload Project, and building the project after that.

0

Please sign in to leave a comment.