作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我要嵌入 Python 3.3 翻译成 Mac OS 10.9 cocoa 应用程序添加一些 Python 功能。根据我从另一个 StackOverflow 问答中读到的内容,最好创建一个静态库(页脚中的引用)而不是动态库。
这是我尝试从 Python 解释器中创建静态库(.a 文件)的内容:
*static*
内Modules/Setup.dist
文件 ./configure LDFLAGS="-static -static-libgcc" CPPFLAGS="-static"
checking build system type... x86_64-apple-darwin13.1.0
checking host system type... x86_64-apple-darwin13.1.0
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... darwin
checking for --without-gcc... no
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Path/To/My/Source/Python-3.3.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
configure:3914: checking whether the C compiler works
configure:3936: clang -static conftest.c >&5
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
最佳答案
我认为它默认构建一个静态库,在基于 Unix 的平台上,包括 OSX。也就是说,只是简单的配置,制作,制作安装。它对我有用并构建了 libpython3.4m.a。但是您可能会考虑使用 --prefix 并阅读有关在 OSX 上安装多个 Python 版本的信息。
您引用的线程是旧的?
Embedding 没有那么奇怪,否则 Python 文档和书籍不会深入讨论它。
关于macos - Mavericks : Compile Python Interpreter into a static lib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22273701/
我是一名优秀的程序员,十分优秀!