Search code examples
python-3.xcx-freeze

fatal error LNK1181: cannot open input file 'imagehlp.lib' installing cx_Freeze


I'm trying to install cx_Freeze on python 3.4 using:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org cx_freeze

However, i'm getting the error

creating build\temp.win-amd64-3.4\Release\source 
C:\VS10\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG - IC:\Python34\include -IC:\Python34\include /Tcsource/util.c /Fobuild\temp.win-amd64-3.4\Release\source/util.obj 
util.c 
C:\VS10\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild\amd64 imagehlp.lib Shlwapi.lib /EXPORT:PyInit_util build\temp.win-amd64-3.4\Release\source/util.obj /OUT:build\lib.win-amd64-3.4\cx_Freeze\util.pyd /IMPLIB:build\temp.win-amd64-3.4\Release\source\util.lib     /MANIFESTFILE:build\temp.win-amd64-3.4\Release\source\util.pyd.manifest 
LINK : fatal error LNK1181: cannot open input file 'imagehlp.lib' 
error: command 'C:\VS10\VC\Bin\link.exe' failed with exit status 1181

Any ideas how to get around this?


Solution

  • The current/default version of cx_Freeze is 5.1.1, and it supports Python 2.7, 3.5 and 3.6 only.

    The latest version of cx_Freeze which supports Python 3.4 is 5.0.2. See the cx_Freeze release notes and the cx-freeze tag info. So you probably should try

    pip install [...] cx_Freeze==5.0.2
    

    where [...] stands for the additional options of your install command.

    I'm not sure whether this incompatibility of versions is the root cause of the specific error you have reported, but it will cause issues at some point in your project.