-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Documentation
When building an application using CXX driver on my M1 mac, I had to repair the executables using the instructions in https://stackoverflow.com/questions/1937232/linking-to-a-dynamic-library-on-a-mac-with-full-path
I am on an macOS Monterrey 12.6 M1 Max. The command I used to build was:
export PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig"
g++ -Wno-deprecated -fsanitize=address,undefined -std=c++17 $(pkg-config --cflags --libs libmongocxx) $(pkg-config --cflags --libs sdl2) -lSDL2_mixer -lSDL2_ttf -o leafie_pong AtlasManager.cpp Main.cpp
The repair code I ran was:
install_name_tool -change @rpath/libbsoncxx._noabi.dylib $HOME/.local/lib/libbsoncxx._noabi.dylib leafie_pong install_name_tool -change @rpath/libmongocxx._noabi.dylib $HOME/.local/lib/libmongocxx._noabi.dylib leafie_pong