Undefined symbols for architecture x86_64: on a MacBook M2.

已回答

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

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

请先登录再写评论。