如何在 Windows 上构建 Python Sybase 模块?

发布于 2024-12-23 15:55:56 字数 3508 浏览 1 评论 0原文

我正在尝试在 Cygwin 上构建 python-sybase 模块,但它似乎不起作用。它似乎开始编译,然后开始抛出以下错误:

$ python setup.py install
running install
running bdist_egg
running egg_info
writing python_sybase.egg-info/PKG-INFO
writing top-level names to python_sybase.egg-info/top_level.txt
writing dependency_links to python_sybase.egg-info/dependency_links.txt
reading manifest file 'python_sybase.egg-info/SOURCES.txt'
writing manifest file 'python_sybase.egg-info/SOURCES.txt'
installing library code to build/bdist.cygwin-1.7.7-i686/egg
running install_lib
running build_py
running build_ext
building 'sybasect' extension
gcc -fno-strict-aliasing -g -O2 -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DWANT_BULKCOPY -DHAVE_DATE                    TIME -DHAVE_DECIMAL -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFE                    R -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHA                    VE_CS_CMP -IC:\Sybase\sql1251/OCS-15_0/include -I/usr/include/python2.6 -c blk.c -o build/temp.cygwin-1.7.7-i686-2.                    6/blk.o

...

build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_bind':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:33: undefined reference to `_blk_bind'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_describe':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:77: undefined reference to `_blk_describe'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_done':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:133: undefined reference to `_blk_done'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_drop':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:166: undefined reference to `_blk_drop'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_init':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:200: undefined reference to `_blk_init'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_props':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:440: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:362: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:283: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:398: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:305: undefined reference to `_blk_props'

我也尝试过 mingw32 编译器,但收到此错误:

$ python setup.py build -c mingw32
running build
running build_py
running build_ext
building 'sybasect' extension
gcc -mno-cygwin -mdll -O -Wall -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -IC:\Sybase\sql1251/OCS-15_0/include -I/usr/include/python2.6 -c blk.c -o build/temp.cygwin-1.7.7-i686-2.6/blk.o
In file included from /usr/include/python2.6/Python.h:58,
                 from sybasect.h:9,
                 from blk.c:9:
/usr/include/python2.6/pyport.h:261:24: sys/select.h: No such file or directory
/usr/include/python2.6/pyport.h:472:24: sys/termio.h: No such file or directory
error: command 'gcc' failed with exit status 1

有人能够在 Windows 上成功编译 Python-Sybase 吗?如果我不能在 Cygwin 中做到这一点,是否有一种简单的方法可以在 Cygwin 之外构建它(使用免费编译器)?

I'm trying to build the python-sybase module on Cygwin, but it doesn't seem to work. It seems to start compiling, then it starts throwing the following errors:

$ python setup.py install
running install
running bdist_egg
running egg_info
writing python_sybase.egg-info/PKG-INFO
writing top-level names to python_sybase.egg-info/top_level.txt
writing dependency_links to python_sybase.egg-info/dependency_links.txt
reading manifest file 'python_sybase.egg-info/SOURCES.txt'
writing manifest file 'python_sybase.egg-info/SOURCES.txt'
installing library code to build/bdist.cygwin-1.7.7-i686/egg
running install_lib
running build_py
running build_ext
building 'sybasect' extension
gcc -fno-strict-aliasing -g -O2 -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DWANT_BULKCOPY -DHAVE_DATE                    TIME -DHAVE_DECIMAL -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFE                    R -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHA                    VE_CS_CMP -IC:\Sybase\sql1251/OCS-15_0/include -I/usr/include/python2.6 -c blk.c -o build/temp.cygwin-1.7.7-i686-2.                    6/blk.o

...

build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_bind':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:33: undefined reference to `_blk_bind'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_describe':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:77: undefined reference to `_blk_describe'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_done':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:133: undefined reference to `_blk_done'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_drop':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:166: undefined reference to `_blk_drop'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_init':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:200: undefined reference to `_blk_init'
build/temp.cygwin-1.7.7-i686-2.6/blk.o: In function `CS_BLKDESC_blk_props':
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:440: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:362: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:283: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:398: undefined reference to `_blk_props'
/home/jjamae/tmp/python-sybase-0.40pre2/blk.c:305: undefined reference to `_blk_props'

I've also tried the mingw32 compiler, but I get this error:

$ python setup.py build -c mingw32
running build
running build_py
running build_ext
building 'sybasect' extension
gcc -mno-cygwin -mdll -O -Wall -DWANT_BULKCOPY -DHAVE_DATETIME -DHAVE_DECIMAL -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -IC:\Sybase\sql1251/OCS-15_0/include -I/usr/include/python2.6 -c blk.c -o build/temp.cygwin-1.7.7-i686-2.6/blk.o
In file included from /usr/include/python2.6/Python.h:58,
                 from sybasect.h:9,
                 from blk.c:9:
/usr/include/python2.6/pyport.h:261:24: sys/select.h: No such file or directory
/usr/include/python2.6/pyport.h:472:24: sys/termio.h: No such file or directory
error: command 'gcc' failed with exit status 1

Has anybody been able to successfully compile Python-Sybase on Windows? If I can't do it in Cygwin, is there an easy way I can I build this (with a free compiler) outside of Cygwin?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

诗化ㄋ丶相逢 2024-12-30 15:55:56

如“安装”页面中所述,您应该能够使用免费的 (Microsoft ) Visual C++ 2005/2008 Express Edition,用于在 Windows 上构建 Python-Sybase。

As described on the 'installation' page, you should be able to use the free (Microsoft) Visual C++ 2005/2008 Express Edition to build Python-Sybase on Windows.

世界等同你 2024-12-30 15:55:56

我遇到了 mingw 的问题,“未定义的引用..”,因此下载了 (Microsoft) Visual C++ 2008 Express Edition 并对其进行了编译...

I had issue with mingw , "undefined reference.." , so downloaded (Microsoft) Visual C++ 2008 Express Edition and it got compiled ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文