When I execute Valgrind on Clion Editor, the following error shows up.
/usr/local/bin/valgrind --tool=memcheck --xml=yes --xml-file=/private/var/folders/gq/r_j6y6112zlccqkwxp0rj_v00000gn/T/clion-valgrind6333974d-afb4-4c0b-8c03-407df60789cf/valgrind_output_%p --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no /Users/hayashi-ay/Projects/tests/cmake-build-debug/main --gtest_filter=* --gtest_color=no
Testing started at 2:10 ...
dyld[8729]: Library not loaded: /usr/lib/libc++.1.dylib
Referenced from: /Users/hayashi-ay/Projects/tests/cmake-build-debug
Reason: tried: '/usr/lib/libc++.1.dylib' (no such file), '/usr/local/lib/libc++.1.dylib' (no such file)
main uses following dynamic libraries
otool -L main
main:
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
But simply run ./main works fine, so I guess valgrind can't handle dynamic linking.
My Environment:
OS:
sw_vers
ProductName: macOS
ProductVersion: 12.0.1
BuildVersion: 21A559
Valgrind:
valgrind --version
valgrind-3.18.0.GIT-lbmacos
CLion:
CLion 2021.2.2
Build #CL-212.5284.51, built on September 17, 2021
Licensed to xxxxxxxxxxxxxx
Subscription is active until October 6, 2022.
For educational use only.
Runtime version: 11.0.12+7-b1504.28 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.0.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2000M
Cores: 8
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: com.intellij.plugins.vscodekeymap (212.3116.29)