Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kiwisolver error ld: error: undefined symbol: main #3122

Open
shivaraj-arch opened this issue Mar 7, 2025 · 5 comments · May be fixed by #3124
Open

kiwisolver error ld: error: undefined symbol: main #3122

shivaraj-arch opened this issue Mar 7, 2025 · 5 comments · May be fixed by #3124
Labels

Comments

@shivaraj-arch
Copy link

shivaraj-arch commented Mar 7, 2025

OS : mac
command: buildozer -v android debug
buildozer.spec : p4a.branch = develop

Can someone point why is this ld error caused while building 'kiwisolver._cext' extension

kiwisolver.error.txt

[DEBUG]: /Users/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -I/Users/workspace/stocks/android/matplotlibapp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/Include -bundle -undefined dynamic_lookup -L/Users/workspace/stocks/android/matplotlibapp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/libs_collections/matplotlibapp/arm64-v8a -L/Users/workspace/stocks/android/matplotlibapp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/android-build -lpython3.11 -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -I/Users/workspace/stocks/android/matplotlibapp/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/Include build/temp.macosx-15.3-arm64-cpython-311/py/src/constraint.o build/temp.macosx-15.3-arm64-cpython-311/py/src/expression.o build/temp.macosx-15.3-arm64-cpython-311/py/src/kiwisolver.o build/temp.macosx-15.3-arm64-cpython-311/py/src/solver.o build/temp.macosx-15.3-arm64-cpython-311/py/src/strength.o build/temp.macosx-15.3-arm64-cpython-311/py/src/term.o build/temp.macosx-15.3-arm64-cpython-311/py/src/variable.o -o build/lib.macosx-15.3-arm64-cpython-311/kiwisolver/_cext.cpython-311-darwin.so -stdlib=libc++

[DEBUG]: clang-14: warning: argument unused during compilation: '-bundle' [-Wunused-command-line-argument]
[DEBUG]: clang-14: warning: argument unused during compilation: '-undefined dynamic_lookup' [-Wunused-command-line-argument]
[DEBUG]: ld: error: undefined symbol: main
[DEBUG]: >>> referenced by crtbegin.c

@AndreMiras AndreMiras transferred this issue from kivy/buildozer Mar 7, 2025
@AndreMiras
Copy link
Member

Did you get this working in the past or is it the first time you're trying?
I'm asking because we made a recent kiwisolver recipe update.
You can verify if this is a regression from #3118 by pointing p4a.commit to the commit before the merge. Start from clean build.
If it's a recent regression then the fix is simple.

@T-Dynamos
Copy link
Contributor

That's same error macos runner is having in github right now.

@shivaraj-arch
Copy link
Author

shivaraj-arch commented Mar 7, 2025

Did you get this working in the past or is it the first time you're trying? I'm asking because we made a recent kiwisolver recipe update. You can verify if this is a regression from #3118 by pointing p4a.commit to the commit before the merge. Start from clean build. If it's a recent regression then the fix is simple.

if __init__.py is replaced, old error resurfaces - Python.h not found.
tried setting env flags but seems its not finding it. should we set them in another file?

@RobertFlatt
Copy link
Contributor

RobertFlatt commented Mar 11, 2025

@T-Dynamos

I think the recipe should have += not = here:

        env["CFLAGS"] = flags
        env["CPPFLAGS"] = flags

Because the log error is due to trying to create an executable, so some compiler flags are wrong. And other recipes use += in this case.

RobertFlatt added a commit to RobertFlatt/python-for-android that referenced this issue Mar 12, 2025
Bump version,  change depends to hostpython_prerequisites.
Fix kivy#3122
@RobertFlatt
Copy link
Contributor

I tried adding the above fix to a very loosely related PR #3124
It did not fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants