Backstory: I started using my terminal for a lot of my school projects. I recently got familiar with it and wanted to "upgrade" by installing iTerm2 and homebrew; but before I installed the two, I was able to compile my C++ homework files "g++ filename.cpp" and run "./a.out" no problem. After installing iTerm2 and homebrew followed by xcode commandline tools I started running into this problem every time I try to compile my c++ files:
"ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
I created a simple "Hello World!" c++ and that won't even compile. I've tried everything even some posts on here. Hopefully someone has a different solution. Thank you in advance!
The code is super simple:
#include<iostream>
using namespace std;
int main() {
cout << "Hello World!" << endl;
return 0;
}
How I tried compiling it: "g++ main.cpp" Which back then I get an a.out file but this time I get that error message shown in the picture.
I added more photos showing my g++ version and also the attempt of compiling it: "g++ -Wall -Wextra -g main.cpp -o prog.bin" I'm also running macOS Catalina 10.15.6 Thank you in advance. I'm reading through the documentations provided rn.
g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
UPDATE: I uninstalled and reinstalled Xcode CommandLineTools and homebrew; however, this time I did not update the CommandLineTools to beta 5 like I did before.
Now I'm able to compile and run my school assignments. Not an ideal solution but I'm back to working on my school assignments peacefully. Thank you all for the help!! I guess installing the beta CommandLineTools is not such a great idea.