3

I need PyMQI on my windows 86x. I try to build setup.py with msvc as compiler But when i try to do it I get the following errors:

C:\Python27\Lib\pymqi-1.5.4>python setup.py build client
Building PyMQI client 32bits
running build
running build_py
running build_ext
building 'pymqi.pymqe' extension
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD
 /W3 /GS- /DNDEBUG -DPYQMI_SERVERBUILD=0 "-Ic:\Program Files\IBM\WebSphere MQ\tools\c\include" -IC:\Python27\include -IC
:\Python27\PC /Tcpymqi/pymqe.c /Fobuild\temp.win32-2.7\Release\pymqi/pymqe.obj
pymqe.c
pymqi/pymqe.c(240) : error C2275: 'MQCSP' : illegal use of this type as an expression
        c:\Program Files\IBM\WebSphere MQ\tools\c\include\cmqc.h(4001) : see declaration of 'MQCSP'
pymqi/pymqe.c(240) : error C2146: syntax error : missing ';' before identifier 'csp'
pymqi/pymqe.c(240) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(240) : error C2059: syntax error : '{'
pymqi/pymqe.c(247) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(247) : error C2224: left of '.AuthenticationType' must have struct/union type
pymqi/pymqe.c(248) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(248) : error C2224: left of '.CSPUserIdPtr' must have struct/union type
pymqi/pymqe.c(249) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(249) : error C2224: left of '.CSPUserIdLength' must have struct/union type
pymqi/pymqe.c(250) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(250) : error C2224: left of '.CSPPasswordPtr' must have struct/union type
pymqi/pymqe.c(251) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(251) : error C2224: left of '.CSPPasswordLength' must have struct/union type
pymqi/pymqe.c(256) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(256) : warning C4133: '=' : incompatible types - from 'int *' to 'PMQCSP'
error: command 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bi
n\\cl.exe' failed with exit status 2
JoshMc
  • 10,239
  • 2
  • 19
  • 38
user3802744
  • 39
  • 1
  • 3
  • [Vincent](http://stackoverflow.com/users/5573130) notes that he has the same problem, running Python 2.7.9 on Windows 7 64 bits with IBM MQ client 8.0.0.4. – cgmb Nov 17 '15 at 18:44
  • I am also facing the same issue. I am running Pythong 2.7.12 on Windows x86 with MQ v7.5.0.2. Has anybody found the solution yet ? – Piyush Nov 18 '16 at 06:02
  • same issue here ... no ideea yet :( – cristi _b Jul 20 '17 at 10:17

1 Answers1

1

There is a solution on this page: https://github.com/dsuch/pymqi/issues/35

First in pymqi/pymqe.c file the declaration line

MQCSP csp = {MQCSP_DEFAULT};

should be moved to the beginning of method pymqe_MQCONNX, right after:

PyObject* user_password = NULL;

After doing this the build and installation succeed but import pymqi gives an error:

ImportError: No module named pymqe

This can be fixed by copying pymqe.pyd from the path \pymqi-1.5.4\build\lib.win32-2.7\pymqi, to pymqi-1.5.4\pymqi

Andrey Grachev
  • 1,259
  • 1
  • 14
  • 22