How can I properly link the python3 framework to my c++ project?

Im trying to link the Python3 framework to a c++ project in Xcode. It gives me a build error that says the python3 framework is not found. I can add the the path to the framework under framework search paths in the build options, this will let the code compile, however when I run it it says

"dyld: Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3 "
"Reason: image not found" .

If I remove the framework and add -lpython3.8 to linker options and then add the library and header locations to the search path this will also compile and fail with the same image not found error. Im on a M1 Macbook Air, Big Sur 11.1, Xcode 12.3. As for a question... I would like to know

"How can I properly link the python3 framework to my c++ project?"
Answered by Rognar in 656064022
I was able to get this working, had to sign into Xcode with my Apple ID , include the python3 framework location in the frameworks search path, include the location of Python.h in header search paths, under frameworks I had to choose embed without signing, I also had to change the Signing Certificate option under Signing & Capabilities to Sign to Run Locally.



Accepted Answer
I was able to get this working, had to sign into Xcode with my Apple ID , include the python3 framework location in the frameworks search path, include the location of Python.h in header search paths, under frameworks I had to choose embed without signing, I also had to change the Signing Certificate option under Signing & Capabilities to Sign to Run Locally.



How can I properly link the python3 framework to my c++ project?
 
 
Q