cannot build pyodbc

156 views
Skip to first unread message

JSk...@gmail.com

unread,
May 14, 2009, 1:02:37 PM5/14/09
to pyodbc
I am getting compliler errors when I try and compile pyodbc for 32bit
ubuntu server edition 8.04.

I have installed build essentials and unixodbc(which includes unixodbc-
dev) installed through apt-get.

I'm hoping I missed something obvious. It appears I am missing
something is messed up on the compiler configuration, and I am not
sure what or how to fix it.

james: ~/pyodbc-2.1.4$ python setup.py build
running build
running build_ext
building 'pyodbc' extension
creating build/temp.linux-i686-2.5/home/james/pyodbc-2.1.4
creating build/temp.linux-i686-2.5/home/james/pyodbc-2.1.4/src
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -
Wstrict-prototypes -fPIC -DPYODBC_MAJOR=2 -DPYODBC_MINOR=1 -
DPYODBC_MICRO=4 -DPYODBC_BUILD=0 -I/usr/include/python2.5 -c /home/
james/pyodbc-2.1.4/src/cursor.cpp -o build/temp.linux-i686-2.5/home/
james/pyodbc-2.1.4/src/cursor.o -Wno-write-strings
cc1plus: warning: command line option "-Wstrict-prototypes" is valid
for Ada/C/ObjC but not for C++
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:16:
/home/james/pyodbc-2.1.4/src/pyodbc.h:35:20: error: Python.h: No such
file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:36:26: error: stringobject.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:37:23: error: intobject.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:38:25: error: floatobject.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:39:24: error: longobject.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:40:24: error: boolobject.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:41:26: error: bufferobject.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:42:27: error: unicodeobject.h:
No such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:43:26: error: structmember.h: No
such file or directory
/home/james/pyodbc-2.1.4/src/pyodbc.h:44:22: error: datetime.h: No
such file or directory
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:16:
/home/james/pyodbc-2.1.4/src/pyodbc.h:60: error: expected initializer
before â*â token
/home/james/pyodbc-2.1.4/src/pyodbc.h:61: error: expected initializer
before â*â token
/home/james/pyodbc-2.1.4/src/pyodbc.h:62: error: expected initializer
before â*â token
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:16:
/home/james/pyodbc-2.1.4/src/pyodbc.h: In function âvoid _strlwr(char*)
â:
/home/james/pyodbc-2.1.4/src/pyodbc.h:107: error: âtolowerâ was not
declared in this scope
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:17:
/home/james/pyodbc-2.1.4/src/cursor.h: At global scope:
/home/james/pyodbc-2.1.4/src/cursor.h:40: error: âPyObject_HEADâ does
not name a type
/home/james/pyodbc-2.1.4/src/cursor.h:54: error: ISO C++ forbids
declaration of âPyObjectâ with no type
/home/james/pyodbc-2.1.4/src/cursor.h:54: error: expected â;â before
â*â token
/home/james/pyodbc-2.1.4/src/cursor.h:81: error: ISO C++ forbids
declaration of âPyObjectâ with no type
/home/james/pyodbc-2.1.4/src/cursor.h:81: error: expected â;â before
â*â token
/home/james/pyodbc-2.1.4/src/cursor.h:97: error: ISO C++ forbids
declaration of âPyObjectâ with no type
/home/james/pyodbc-2.1.4/src/cursor.h:97: error: expected â;â before
â*â token
/home/james/pyodbc-2.1.4/src/cursor.h:103: error: expected
constructor, destructor, or type conversion before â*â token
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:18:
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:17: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:18: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:19: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:20: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:21: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:22: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:23: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:24: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:25: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:26: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:30: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:31: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:32: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:33: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:34: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:35: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:36: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:38: error:
âPyDecimal_Checkâ declared as an âinlineâ variable
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:38: error: âPyObjectâ was
not declared in this scope
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:38: error: âpâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:39: error: expected â,â or
â;â before â{â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:45: error: âPyTypeObjectâ
does not name a type
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:46: error: âPyTypeObjectâ
does not name a type
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:47: error: âPyTypeObjectâ
does not name a type
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:50: error: expected
initializer before â*â token
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h: In function âbool
lowercase()â:
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:54: error: âpModuleâ was
not declared in this scope
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:54: error:
âPyObject_GetAttrStringâ was not declared in this scope
/home/james/pyodbc-2.1.4/src/pyodbcmodule.h:54: error: âPy_Trueâ was
not declared in this scope
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:19:
/home/james/pyodbc-2.1.4/src/connection.h: At global scope:
/home/james/pyodbc-2.1.4/src/connection.h:17: error: âPyTypeObjectâ
does not name a type
/home/james/pyodbc-2.1.4/src/connection.h:21: error: âPyObject_HEADâ
does not name a type
/home/james/pyodbc-2.1.4/src/connection.h:34: error: ISO C++ forbids
declaration of âPyObjectâ with no type
/home/james/pyodbc-2.1.4/src/connection.h:34: error: expected â;â
before â*â token
/home/james/pyodbc-2.1.4/src/connection.h:51: error: expected
constructor, destructor, or type conversion before â*â token
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:20:
/home/james/pyodbc-2.1.4/src/row.h:22: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/row.h:22: error: âdescriptionâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/row.h:22: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/row.h:22: error: âmap_name_to_indexâ was
not declared in this scope
/home/james/pyodbc-2.1.4/src/row.h:22: error: expected primary-
expression before âcValuesâ
/home/james/pyodbc-2.1.4/src/row.h:22: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/row.h:22: error: âapValuesâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/row.h:22: error: initializer expression
list treated as compound expression
/home/james/pyodbc-2.1.4/src/row.h:31: error: âPyObjectâ has not been
declared
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:21:
/home/james/pyodbc-2.1.4/src/buffer.h:19: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/buffer.h:19: error: âbufferâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/buffer.h:19: error: expected primary-
expression before âconstâ
/home/james/pyodbc-2.1.4/src/buffer.h:19: error: initializer
expression list treated as compound expression
/home/james/pyodbc-2.1.4/src/buffer.h:26: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/buffer.h:26: error: âselfâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/buffer.h:31: error: ISO C++ forbids
declaration of âPyObjectâ with no type
/home/james/pyodbc-2.1.4/src/buffer.h:31: error: expected â;â before
â*â token
/home/james/pyodbc-2.1.4/src/buffer.h:36: error: expected `)' before
â*â token
/home/james/pyodbc-2.1.4/src/buffer.h: In member function âbool
BufferSegmentIterator::Next(byte*&, SQLINTEGER&)â:
/home/james/pyodbc-2.1.4/src/buffer.h:49: error: âPyBufferProcsâ was
not declared in this scope
/home/james/pyodbc-2.1.4/src/buffer.h:49: error: âprocsâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/buffer.h:49: error: âpBufferâ was not
declared in this scope
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:22:
/home/james/pyodbc-2.1.4/src/params.h: At global scope:
/home/james/pyodbc-2.1.4/src/params.h:7: error: âPyObjectâ has not
been declared
/home/james/pyodbc-2.1.4/src/params.h:7: error: âPyObjectâ has not
been declared
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:23:
/home/james/pyodbc-2.1.4/src/errors.h:12: error: expected constructor,
destructor, or type conversion before â*â token
/home/james/pyodbc-2.1.4/src/errors.h:24: error: expected constructor,
destructor, or type conversion before â*â token
/home/james/pyodbc-2.1.4/src/errors.h:37: error: expected constructor,
destructor, or type conversion before â*â token
/home/james/pyodbc-2.1.4/src/errors.h:44: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/errors.h:44: error: âexâ was not declared
in this scope
/home/james/pyodbc-2.1.4/src/errors.h:44: error: expected primary-
expression before âconstâ
/home/james/pyodbc-2.1.4/src/errors.h:44: error: initializer
expression list treated as compound expression
/home/james/pyodbc-2.1.4/src/errors.h:50: error: âbool HasSqlState
(void*, const char*)â redeclared as different kind of symbol
/home/james/pyodbc-2.1.4/src/errors.h:44: error: previous declaration
of âbool HasSqlStateâ
In file included from /home/james/pyodbc-2.1.4/src/cursor.cpp:24:
/home/james/pyodbc-2.1.4/src/getdata.h:7: error: expected constructor,
destructor, or type conversion before â*â token
/home/james/pyodbc-2.1.4/src/cursor.cpp: In function âbool
StatementIsValid(Cursor*)â:
/home/james/pyodbc-2.1.4/src/cursor.cpp:38: error: âstruct Cursorâ has
no member named âcnxnâ
/home/james/pyodbc-2.1.4/src/cursor.cpp:38: error: âstruct Cursorâ has
no member named âcnxnâ
/home/james/pyodbc-2.1.4/src/cursor.cpp: At global scope:
/home/james/pyodbc-2.1.4/src/cursor.cpp:41: error: âPyTypeObjectâ does
not name a type
/home/james/pyodbc-2.1.4/src/cursor.cpp:44: error: âCursor_Checkâ
declared as an âinlineâ variable
/home/james/pyodbc-2.1.4/src/cursor.cpp:44: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/cursor.cpp:44: error: âoâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/cursor.cpp:45: error: expected â,â or â;â
before â{â token
/home/james/pyodbc-2.1.4/src/cursor.cpp:50: error: âPyObjectâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/cursor.cpp:50: error: âobjâ was not
declared in this scope
/home/james/pyodbc-2.1.4/src/cursor.cpp:50: error: expected primary-
expression before âflagsâ
/home/james/pyodbc-2.1.4/src/cursor.cpp:50: error: initializer
expression list treated as compound expression
/home/james/pyodbc-2.1.4/src/cursor.cpp:51: error: expected â,â or â;â
before â{â token
error: command 'gcc' failed with exit status 1

JSk...@gmail.com

unread,
May 14, 2009, 6:30:17 PM5/14/09
to pyodbc
solved, I missed a requirement.
sudo apt-get install python2.5-dev
thanks to.
http://ubuntuforums.org/showthread.php?t=910825

rach...@gmail.com

unread,
Feb 13, 2013, 7:06:09 PM2/13/13
to pyo...@googlegroups.com
Thank you! This helped me.
Reply all
Reply to author
Forward
0 new messages