[PyQt] Problems using SIP with visual studio

Scener Spanish spscener84 at gmail.com
Sun May 31 16:41:26 BST 2015


I understand, It seems the tutorial I was following didn't have a valid
hellosip.sip file. After adding the missing include <string.h> and repeated
the process:

- Clean.bat
- rm sip*
- Build.bat
- python configure.py
- nmake

I got a new error with an invalid pyd module:

D:\Sources\Python\console\sip_tests\test1>nmake

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W3 -w34100 -w34189
-DNDEBUG -
DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -I. -IC:\Python275\include -Fo
@C:\Users\KneDa\AppData\Local\Temp\nmCF71.tmp
siphellosipcmodule.cpp
siphellosipstdstring.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323)
: warning C4530: C++ exception handler used, but unwind semantics are not
enabled. Specify /EHsc
siphellosipHelloSip.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323)
: warning C4530: C++ exception handler used, but unwind semantics are not
enabled. Specify /EHsc
Generating Code...
        link -L. /NOLOGO /DYNAMICBASE /NXCOMPAT /DLL /MANIFEST
/MANIFESTFILE:hellosip.pyd.manifest /SUBSYSTEM:WINDOWS /INCREMENTAL:NO
/OUT:hellosip.pyd @C:\Users\KneDa\AppData\Local\Temp\nmD1D2.tmp
LINK : warning LNK4044: unrecognized option '/L.'; ignored
LINK : fatal error LNK1149: output filename matches input filename
'D:\Sources\Python\console\sip_tests\test1\hellosip.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\BIN\amd64\link.EXE"' : return code '0x47d'
Stop.

Although that linker error raises a new *.pyd file has been generated, but
If I try to import it I got this:

D:\Sources\Python\console\sip_tests\test1>python -c "import hellosip"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.

Any help?

Regards

On Sun, May 31, 2015 at 4:57 PM, Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 30/05/2015 7:50 pm, Scener Spanish wrote:
>
>> Hello all,
>>
>> I've recently started my first steps learning SIP and I intend to use it
>> with visual studio 2010 to port some of my old c/c++ vs projects to
>> python.
>> Before doing that I've decided to make work a very simple hello world
>> package I've created to understand the very basics of SIP (workflow).
>> Here's the package link
>> <https://www.dropbox.com/s/yja7ptllso2x11m/test1.7z?dl=0>.with a simple
>> dll
>>
>> ready to go and an example application using it, as well as a sip wrapper
>> and a configure.py to create the makefile...
>>
>> The steps I follow are these ones:
>>
>> - I use Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit
>> (AMD64)] on win32
>> - I open a Microsoft Visual Studio 2010 x64 tools command prompt to test
>> the package
>> - I compile & install succesfully sip 4.16.7
>> - I'm able to create my c++ test dll and the c++ unit test application
>> running the provided build.bat
>> - I'm able to create the makefile using the attached configure.py using #
>> python configure.py
>> - The problems appear when I try to build the python wrapper running
>> nmake,
>> I got multiple errors and I don't understand their meaning, the visual
>> studio output would be this:
>>
>>
>> ------------------------------------------------------------------------------------------------
>> Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>>     cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W3 -w34100 -w34189 -DNDEBUG
>> -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -I. -IC:\Python275\include -Fo
>> @C:\Users\KneDa\AppData\Local\Temp\nmF0E7.tmp
>> siphellosipstdstring.cpp
>> hellosip.sip(22) : error C2006: '#include' : expected a filename, found
>> 'newline'
>> hellosip.sip(22) : fatal error C1083: Cannot open include file: '': No
>> such
>> file or directory
>> siphellosipHelloSip.cpp
>> C:\Program Files (x86)\Microsoft Visual Studio
>> 10.0\VC\INCLUDE\xlocale(323)
>> : warning C4530: C++ exception handler used, but unwind semantics are not
>> enabled. Specify /EHsc
>> hellosip.sip(22) : error C2006: '#include' : expected a filename, found
>> 'newline'
>> hellosip.sip(22) : fatal error C1083: Cannot open include file: '': No
>> such
>> file or directory
>> Generating Code...
>> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
>> Studio
>> 10.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
>> Stop.
>>
>> ------------------------------------------------------------------------------------------------
>>
>> Thanks a lot for any info.
>>
>
> The error messages describe the problem - there is no filename after the
> #include.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150531/56ec1421/attachment-0001.html>


More information about the PyQt mailing list