Obs-studio: [BUG] Undefined symbols for architecture x86_64: "_PyObject_CallFunction", referenced from:

Created on 9 Apr 2020  路  5Comments  路  Source: obsproject/obs-studio

Platform

Operating system and version:
mac OS 10.15 (19A583), Xcode 11.3.1锛孭ython 3.7.4
OBS Studio version: the latest source code from master branch

Expected Behavior

cmake finish, i got the app

Current Behavior

[ 26%] Building C object deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-python-import.c.o
[ 26%] Linking CXX shared library libobs-scripting.dylib
Undefined symbols for architecture x86_64:
"_PyObject_CallFunction", referenced from:
_SwigPyObject_dealloc in obs-scripting-python.c.o
(maybe you meant: _Import_PyObject_CallFunctionObjArgs)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: * [deps/obs-scripting/libobs-scripting.dylib] Error 1
make[1]:
[deps/obs-scripting/CMakeFiles/obs-scripting.dir/all] Error 2
make: *
* [all] Error 2

Steps to Reproduce

i follow the instructions in mac os, run "cmake .. && make" in build directory

macOS

Most helpful comment

I was stuck on this, installing many different versions of Python didn't do the trick, but finally figured out how to disable python:

cmake -DDISABLE_PYTHON=true ..

All 5 comments

As far as I am aware, Python support does not work on macOS. Please disable it in your cmake config.

@FarzadKarkhani i donnot know how to disable the config

@zanyfly I also don't know how to disable the config. Though I had the same error and after some persistence had master building using

# Use the following 2 outputs for cmake -DPYTHON_INCLUDE_DIR= params.
python3.7-config --includes --ldflags
python3.7-config --ldflags
cmake -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin .. && make -j

Though when running ./obs I get

error: os_dlopen(libpython3.8.dylib->libpython3.8.dylib): dlopen(libpython3.8.dylib, 257): image not found

warning: [Python] Could not load library: libpython3.8.dylib
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed

So I guess my default python being 3.8 I need to work out how to use 3.7 at runtime as well at install time?

I was stuck on this, installing many different versions of Python didn't do the trick, but finally figured out how to disable python:

cmake -DDISABLE_PYTHON=true ..

@dsample that works thanks

Was this page helpful?
0 / 5 - 0 ratings