M1Mac中的"symbol(s) not found for architecture arm64"怎么解

How to solve the "symbol(s) not found for architecture arm64" in M1 Mac

Mac的新用户OS我不会编译c++代码。

该主题与以下内容相关: and this

我尝试了提到的方法,但没有用。

Undefined symbols for architecture arm64:
  "Menu::affichageMenu()", referenced from:
      _main in note_soft-276eef.o
  "Menu::setC(int)", referenced from:
      _main in note_soft-276eef.o
  "Menu::choice()", referenced from:
      _main in note_soft-276eef.o
  "Menu::Menu()", referenced from:
      _main in note_soft-276eef.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

```{shell}
I need your help knowing that I rarely use c++ to code.

  [1]: 
  [2]: https://github.com/exercism/exercism/issues/5476

问题可以通过两种类型的操作解决:

  1. 使用 cmake 管理编译
  2. 或者将所有文件(头文件和源文件)放在同一个目录下