Have trouble compiling pyodbc on Centos

861 views
Skip to first unread message

rob.d...@5one.co.uk

unread,
Sep 11, 2012, 1:18:12 PM9/11/12
to pyo...@googlegroups.com
Hi

I am having trouble compiling pyodbc 3.0.6 on Centos 5

[root@aaaaa pyodbc-3.0.6]# uname -a
Linux aaaaa 2.6.18-308.8.2.el5 #1 SMP Tue Jun 12 09:58:12 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

[root@aaaaa pyodbc-3.0.6]# python -V
Python 2.4.3

[root@aaaaa pyodbc-3.0.6]# isql --version
unixODBC 2.2.11

[root@aaaa pyodbc-3.0.6]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)

[root@aaaaa pyodbc-3.0.6]# python setup.py install --record files.txt
running install
running build
running build_ext
building 'pyodbc' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC -DPYODBC_VERSION=3.0.6 -I/usr/include/python2.4 -c /mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp -o build/temp.linux-x86_64-2.4/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.o -Wno-write-strings
/mnt/ds/Rob/pyodbc-3.0.6/src/connection.h:27: error: âuintptr_tâ does not name a type
/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp: In function âint Cursor_setnoscan(PyObject*, PyObject*, void*)â:
/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp:1988: error: âuintptr_tâ was not declared in this scope
/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp:1988: error: expected `;' before ânoscanâ
/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp:1991: error: ânoscanâ was not declared in this scope
/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp: At global scope:
/mnt/ds/Rob/pyodbc-3.0.6/src/cursor.cpp:2082: error: invalid conversion from âconst char*â to âchar*â
error: command 'gcc' failed with exit status 1

Any ideas?

Thanks

Rob

tzur.tu...@gmail.com

unread,
Dec 13, 2012, 8:34:59 AM12/13/12
to pyo...@googlegroups.com
I am getting the same error, some invalid chars while the gcc c++ compiler is... compiling.
When I look at the files, all those weird chars do not exist, so I think it's somehow related to the gcc locale (not system locale because it's utf8) haven't found it tho

rach...@gmail.com

unread,
Feb 13, 2013, 7:02:24 PM2/13/13
to pyo...@googlegroups.com
Hi
I was getting these same errors before I updated to Python 2.6.8. Maybe you could try that? I'm working on Centos, so had to specifically install a missing requirement 'python26-devel' as well.
Hope it helps!

rmohamme

unread,
Mar 21, 2014, 3:37:20 PM3/21/14
to pyo...@googlegroups.com
I'm getting the following error installing on Centos 6.5

[razi@localhost pyodbc-3.0.7]$ python setup.py build

running build
running build_ext
building 'pyodbc' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 -I/usr/include/python2.6 -c /home/razi/Downloads/pyodbc-3.0.7/src/pyodbcdbg.cpp -o build/temp.linux-x86_64-2.6/home/razi/Downloads/pyodbc-3.0.7/src/pyodbcdbg.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

Larry Martell

unread,
Mar 21, 2014, 4:07:13 PM3/21/14
to pyo...@googlegroups.com
You need g++

yum install  'gcc-c++' 

Larry Martell

unread,
Mar 21, 2014, 4:08:25 PM3/21/14
to pyo...@googlegroups.com
I'm pretty sure pyodbc requires python 2.7
 
Reply all
Reply to author
Forward
0 new messages