Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on Mac #286

Open
GuanmingQiao opened this issue Mar 21, 2024 · 2 comments
Open

Build failure on Mac #286

GuanmingQiao opened this issue Mar 21, 2024 · 2 comments

Comments

@GuanmingQiao
Copy link

GuanmingQiao commented Mar 21, 2024

Hi, thank you so much for this wonderful project.

I am trying to build z3-sys on my Mac, but it gives the following errors:

The C++ compiler
"/usr/bin/c++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/Users/guanmingqiao/Documents/GitHub/fuzzing/dev-container/target/debug/build/z3-sys-f13183a96b36c416/out/build/CMakeFiles/CMakeScratch/TryCompile-YEUaeW'
Run Build Command(s): /usr/local/Cellar/cmake/3.27.8/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_3f76d/fast
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_3f76d.dir/build.make CMakeFiles/cmTC_3f76d.dir/build
/usr/bin/c++ -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-apple-darwin -mmacosx-version-min=10.7 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -MD -MT CMakeFiles/cmTC_3f76d.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_3f76d.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_3f76d.dir/testCXXCompiler.cxx.o -c "/Users/guanmingqiao/Documents/GitHub/fuzzing/dev-container/target/debug/build/z3-sys-f13183a96b36c416/out/build/CMakeFiles/CMakeScratch/TryCompile-YEUaeW/testCXXCompiler.cxx"
clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
Linking CXX executable cmTC_3f76d
/usr/local/Cellar/cmake/3.27.8/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3f76d.dir/link.txt --verbose=1
/usr/bin/c++ -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-apple-darwin -mmacosx-version-min=10.7 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_3f76d.dir/testCXXCompiler.cxx.o -o cmTC_3f76d
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_3f76d] Error 1
make: *** [cmTC_3f76d/fast] Error 2
CMake will not be able to correctly generate this project.

It seems the core problems is ld: library not found for -lstdc++.

My environment is:

  • MacOS Ventura Version 13.6.3
  • XCode version 14.3

I tried to re-install XCode, but it didn't work. Any help would be much appreciated!

@yqylovy
Copy link

yqylovy commented Mar 29, 2024

Had it solved? I got same error.

@yqylovy
Copy link

yqylovy commented Apr 9, 2024

Hope it help:

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants