Search code examples
c++clangapple-m1

ld: can't open output file for writing: execs/aligns, errno=2 for architecture arm64


I created a small program to learn some concepts of STL, but when I compile, I get following error:

ld: can't open output file for writing: execs/aligns, errno=2 for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Compiled with:

g++ --std=c++17 aligns.cpp -o execs/aligns

I am using M1 MacBook.

Thanks in advance!!!


Solution

  • I have finally found the solution!

    Folder 'execs' simply didn't exist)))