0

Hi when I am trying to run my C++ program I firstly get this error:

<inline asm>:1:2: note: instantiated into assembly here
        int $3
        ^

then i change this line of code in catch.hpp

 #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */

to this

#define CATCH_TRAP() __asm__(".inst 0xd4200000")

and then i get this

Undefined symbols for architecture arm64:
  "parse_matrix(std::__1::basic_istream<char, std::__1::char_traits<char> >&)", referenced from:
      ____C_A_T_C_H____T_E_S_T____0() in tests-arr-01.cpp.o
      ____C_A_T_C_H____T_E_S_T____12() in tests-arr-01.cpp.o
  "parse_matrix(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::pair<unsigned long, unsigned long> const&)", referenced from:
      ____C_A_T_C_H____T_E_S_T____12() in tests-arr-01.cpp.o
  "print_matrix(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::pair<unsigned long, unsigned long> const&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
      ____C_A_T_C_H____T_E_S_T____31() in tests-arr-01.cpp.o
ld: symbol(s) not found for architecture arm64

This issue happens in a bigger project with more than 1 cpp file. I have tried everything what I found on internet. Did somebody already solve this errors on M1 chips or maybe you have some tips how to run it?

Batman
  • 61
  • 5
  • *"I firstly get this error:"* -- that is a note to an error. It is part of the error message, but not particularly informative on its own. What came before this note? – JaMiT Oct 08 '22 at 18:14
  • error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not? CATCH_BREAK_INTO_DEBUGGER(); ^ note: expanded from macro 'CATCH_BREAK_INTO_DEBUGGER' #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }() note: expanded from macro 'CATCH_TRAP' #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ ^ :1:2: note: instantiated into assembly here int $3 ^ – Batman Oct 08 '22 at 18:38
  • 1
    please show a [mre] – Alan Birtles Oct 08 '22 at 19:02
  • i can not send some example, because this only happens in a bigger project... – Batman Oct 08 '22 at 19:22
  • You can still do as @AlanBirtles asked - please read the link. – Paul Sanders Oct 08 '22 at 21:11
  • @Batman *"i can not send some example, because this only happens in a bigger project"* -- how much bigger? If you take your big project and remove any one of the files, does the error go away? How few files can you get it down to? Among those files, what can you strip out? Remember that functionality is unimportant -- reproducing the error is what's important. – JaMiT Oct 08 '22 at 22:11
  • so i have finally found an issue, my methods were not implemented and that's why I occurred this error, won't lie pretty dumb error..., so advice for all check your code properly before running tests... :) – Batman Oct 08 '22 at 22:28

0 Answers0