Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2579

Extra Steps Needed to Build on arm64

      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
      

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: