skip to Main Content

I have downloaded SDL2.frameworks from https://www.libsdl.org and installed it into /Libraries/Frameworks/. Then I have pointed xcode a path of frameworks and headers in ‘Build Settings’, in ‘General’ ‘Frameworks and Libraries’ pointed at framework file libSDL2-2.0.0.dylib . The I type #include <SDL2/SDL.h> and try to build the project. It shows 150+ warnings, but if I try to Run the program it says that Library not loaded. Why? what is the problem? I’m using Big Sur OS
picture1
build settings
general

2

Answers


  1. I have figured it out.

    1. I have installed homebrew from https://brew.sh
    2. I typed in terminal brew install sdl2
    3. Then I have showed the path of framework (in xCode select project file >> build settings >> header search paths) and using cmd+shift+g type /usr/local/include
    4. In General Frameworks & Libraries put libSDL2-2.0.0.dylib (its here
      /usr/local/Cellar/sdl2/2.0.14_1/lib)
    5. And most important I have checked Disable Library Validations in Signing & Capabilities

    After these steps code started to work for me

    Login or Signup to reply.
  2. You need to codesign the Framework.(The command by the Lazy Foo may be not right).

    1. Find out one’s own signature:
    security find-identity
    
    1. Sign the frameworks:
    codesign -f -s "XXXX Your signature" SDL2.framework
    

    Don’t forget to sign the another hidapi.framework within the ./Versions/A/Frameworks.

    1. You can verify the signature:
    codesign -display --verbose=4 SDL2.framework
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search