Cannot build in debug configuration on Windows
ParaView (5.7.0) fails to build with Python 3 on Windows in Debug configuration. It says it cannot find python37.lib for quite a few projects related to Python wrappers, but the projects all indicate that the proper python37_d.lib is being linked. The full linker output looks like:
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
Starting pass 1
Processed /DEFAULTLIB:python37.lib
Processed /DEFAULTLIB:msvcprtd
Processed /DEFAULTLIB:MSVCRTD
Processed /DEFAULTLIB:OLDNAMES
Searching libraries
<... omitted for brevity. TLDR version: it found all the dependent libs given by the link command (including python37_d.lib) ... >
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\kernel32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\user32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\gdi32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\winspool.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\shell32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\ole32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\oleaut32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\uuid.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\comdlg32.lib:
Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64\advapi32.lib:
LINK : fatal error LNK1104: cannot open file 'python37.lib'
The link command does not provide this flag. Some how /DEFAULTLIB:python37.lib snuck in here. I did a DUMPBIN command on the object files to see which object had the directive, and it turns out most of the objects had it:
Microsoft (R) COFF/PE Dumper Version 14.16.27034.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file G:\dev\ParaView-v5.7.0_Build\VTK\Wrapping\PythonCore\WrappingPythonCore.dir\Debug\PyVTKExtras.obj
File Type: COFF OBJECT
SECTION HEADER #1
.drectve name
0 physical address
0 virtual address
132 size of raw data
794 file pointer to raw data (00000794 to 000008C5)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
100A00 flags
Info
Remove
1 byte align
Linker Directives
-----------------
/FAILIFMISMATCH:_CRT_STDIO_ISO_WIDE_SPECIFIERS=0
/DEFAULTLIB:python37.lib
/FAILIFMISMATCH:_MSC_VER=1900
/FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=2
/FAILIFMISMATCH:RuntimeLibrary=MDd_DynamicDebug
/DEFAULTLIB:msvcprtd
/DEFAULTLIB:MSVCRTD
/DEFAULTLIB:OLDNAMES
/EXPORT:PyVTKAddFile_PyVTKExtras
Summary
132 .drectve
I could not find a #pramga
call in the code that declared it. Any idea where the /DEFAULTLIB:python37.lib
linker directive is coming from?
Edited by Keith Ballard