[PyQt] How to compile 64 bit SIP? (error LNK1112: module machine type 'x64' conflicts with target machine type 'X86')

Phil Thompson phil at riverbankcomputing.com
Fri Jul 18 23:09:48 BST 2014


On 18/07/2014 8:49 pm, klo uo wrote:
> Hi,
> 
> I have a 64 bit Python 2.7 with 64 bit PyQt4 4.10.4
> I want to build a package that depends on SIP
> I downloaded latest release and tried to build it in 64 bit VS CLI:
> 
> ========================================
> D:\src\sip-4.16.2>python configure.py
> This is SIP 4.16.2 for Python 2.7.8 on win32.
> The SIP code generator will be installed in C:\Python27.
> The sip module will be installed in C:\Python27\Lib\site-packages.
> The sip.h header file will be installed in C:\Python27\include.
> The default directory to install .sip files in is C:\Python27\sip.
> Creating siplib\sip.h...
> Creating siplib\siplib.c...
> Creating siplib\siplib.sbf...
> Creating sipconfig.py...
> Creating top level Makefile...
> Creating sip code generator Makefile...
> Creating sip module Makefile...
> 
> D:\src\sip-4.16.2>nmake
> 
> Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
>         cd sipgen
>         "C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\BIN\nmake.exe"
> 
> Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
>         cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W0 -DNDEBUG 
> -DUNICODE
> -DWIN32 -DQT_LARGEFILE_SUPPORT -I. -Fo
> @C:\Users\klo\AppData\Local\Temp\nm574B.tmp
> main.c
> transform.c
> gencode.c
> extracts.c
> export.c
> heap.c
> parser.c
> lexer.c
> Generating Code...
>         link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /MANIFEST
> /MANIFESTFILE:sip.exe.manifest /SUBSYSTEM:CONSOLE
> /OUT:sip.exe @C:\Users\klo\AppData\Local\Temp\nm6F77.tmp
>         mt -nologo -manifest sip.exe.manifest -outputresource:sip.exe;1
>         cd siplib
>         "C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\BIN\nmake.exe"
> 
> Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
>         cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W0 -DNDEBUG 
> -DUNICODE
> -DWIN32 -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -Fo
> @C:\Users\klo\AppData\Local\Temp\nm71C8.tmp
> siplib.c
> apiversions.c
> descriptors.c
> qtlib.c
> threads.c
> objmap.c
> voidptr.c
> array.c
> Generating Code...
>         cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W0 -DNDEBUG 
> -DUNICODE
> -DWIN32 -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\include -Fo
> @C:\Users\klo\AppData\Local\Temp\nm78DD.tmp
> bool.cpp
>         link /NOLOGO /DYNAMICBASE /NXCOMPAT /DLL /MANIFEST
> /MANIFESTFILE:sip.pyd.manifest /SUBSYSTEM:CONSOLE /INCREMENTAL:NO
> /OUT:sip.pyd @C:\Users\klo\AppData\Local\Temp\nm799A.tmp
> python27.lib(python27.dll) : fatal error LNK1112: module machine type 
> 'x64'
> conflicts with target machine type 'X86'
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
> Studio
> 12.0\VC\BIN\link.EXE"' : return code '0x458'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
> Studio
> 12.0\VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
> ----------------------------------------
> 
> Command "python configure.py --show-platforms" doesn't show any 64 bit
> Windows target, nor I see instructions for such scenario anywhere in
> documentation.
> 
> Is it possible, and if so please advise how to?

You have to configure your compiler to generate 64 bit code. This has 
nothing to do with sip.

Phil


More information about the PyQt mailing list