By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,433 Members | 776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,433 IT Pros & Developers. It's quick & easy.

_imp__* linking errors when compiling extension using Mingw

P: n/a
Hi,

When compiling Sketch's streamfilter C extension the errors below are
raised during linking. What could cause the errors?
(Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98)

Here are the occurrences of FilterType that may be relevant:
-------
C:\sketch\sketch-0.7.12\Filter\filterobj.c: 949: PyTypeObject
FilterType = {
C:\sketch\sketch-0.7.12\Filter\filterobj.h: 89: extern
DL_IMPORT(PyTypeObject) FilterType;
-------

setup.py contents:
-------
from distutils.core import setup, Extension
filter_dir = "Filter/"
setup(name = "sketch", ext_modules=[
Extension("streamfilter", [filter_dir+filename for filename in
("streamfilter.c", "filterobj.c", "linefilter.c",
"subfilefilter.c", "base64filter.c","nullfilter.c",
"stringfilter.c", "binfile.c", "hexfilter.c")])])
-------

Linking errors:
-------
running build
running build_ext
building 'streamfilter' extension
creating build
creating build\temp.win32-2.3
creating build\temp.win32-2.3\Release
creating build\temp.win32-2.3\Release\filter
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/linefilter.c -o
build\temp.win32-2.3\Release\filter\linefilter.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/filterobj.c -o
build\temp.win32-2.3\Release\filter\filterobj.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/nullfilter.c -o
build\temp.win32-2.3\Release\filter\nullfilter.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/hexfilter.c -o
build\temp.win32-2.3\Release\filter\hexfilter.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/streamfilter.c -o
build\temp.win32-2.3\Release\filter\streamfilter.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/binfile.c -o
build\temp.win32-2.3\Release\filter\binfile.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/base64filter.c -o
build\temp.win32-2.3\Release\filter\base64filter.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/stringfilter.c -o
build\temp.win32-2.3\Release\filter\stringfilter.o
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\PYTHON\include
-IC:\PYTHON\PC -c Filter/subfilefilter.c -o
build\temp.win32-2.3\Release\filter\subfilefilter.o
writing build\temp.win32-2.3\Release\filter\streamfilter.def
creating build\lib.win32-2.3
C:\MINGW\BIN\gcc.exe -mno-cygwin -mdll -static -s
build\temp.win32-2.3\Release\filter\streamfilter.o
build\temp.win32-2.3\Release\filter\filterobj.o
build\temp.win32-2.3\Release\filter\linefilter.o
build\temp.win32-2.3\Release\filter\subfilefilter.o
build\temp.win32-2.3\Release\filter\base64filter.o
build\temp.win32-2.3\Release\filter\nullfilter.o
build\temp.win32-2.3\Release\filter\stringfilter.o
build\temp.win32-2.3\Release\filter\binfile.o
build\temp.win32-2.3\Release\filter\hexfilter.o
build\temp.win32-2.3\Release\filter\streamfilter.def -LC:\PYTHON\libs
-LC:\PYTHON\PCBuild -lpython23 -o build\lib.win32-2.3\streamfilter.pyd
build\temp.win32-2.3\Release\filter\streamfilter.o(.text+0xda):stre amfilter.c:
undefined reference to `_imp__FilterType'
build\temp.win32-2.3\Release\filter\filterobj.o(.text+0xdf):filtero bj.c:
undefined reference to `_imp__FilterType'
build\temp.win32-2.3\Release\filter\filterobj.o(.text+0x21e):filter obj.c:
undefined reference to `_imp__FilterType'
build\temp.win32-2.3\Release\filter\filterobj.o(.text+0x534):filter obj.c:
undefined reference to `_imp__FilterType'
build\temp.win32-2.3\Release\filter\filterobj.o(.text+0x604):filter obj.c:
undefined reference to `_imp__FilterType'
build\temp.win32-2.3\Release\filter\filterobj.o(.text+0x64e):filter obj.c:
more undefined references to `_imp__FilterType' follow
error: command 'gcc' failed with exit status 1
-------
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.