Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

macos

g++

arm64

new user of Mac OS I can't compile the c++ code.

This topic is related to : this and this

I tried the methods mentioned but it doesn't work.

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]: https://stackoverflow.com/questions/32425361/ld-symbols-not-found-for-architecture-x86-64-clang-linker-command-failed
  [2]: https://github.com/exercism/exercism/issues/5476
like image 714
Marc Avatar asked Nov 15 '22 19:11

Marc


1 Answers

The problem can be solved with 2 types of actions:

  1. manage compilation with cmake
  2. or put all files (headers and sources files) in the same directory
like image 127
Marc Avatar answered May 13 '23 06:05

Marc