moyix / pdbparse

Python code to parse Microsoft PDB files
Other
316 stars 84 forks source link

Failed installing under Windows #34

Closed seanlis closed 7 years ago

seanlis commented 7 years ago

Hi,

I got the following errors while building wheel using python 3.6 32bit.

> pip install pdbparse
Collecting pdbparse                                                                                                                        
  Using cached pdbparse-1.2.tar.gz                                                                                                         
Building wheels for collected packages: pdbparse                                                                                           
  Running setup.py bdist_wheel for pdbparse ... error                                                                                      
  Complete output from command d:\src\python\envs\36-32\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sean\\Ap
ata\\Local\\Temp\\pip-build-h6vbtw1u\\pdbparse\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f
lose();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\sean\AppData\Local\Temp\tmpxieegev2pip-wheel- --python-tag cp36:     
  running bdist_wheel                                                                                                                      
  running build                                                                                                                            
  running build_py                                                                                                                         
  creating build                                                                                                                           
  creating build\lib.win32-3.6                                                                                                             
  creating build\lib.win32-3.6\pdbparse                                                                                                    
  copying pdbparse\dbgold.py -> build\lib.win32-3.6\pdbparse                                                                               
  copying pdbparse\dbi.py -> build\lib.win32-3.6\pdbparse                                                                                  
  copying pdbparse\fpo.py -> build\lib.win32-3.6\pdbparse                                                                                  
  copying pdbparse\gdata.py -> build\lib.win32-3.6\pdbparse                                                                                
  copying pdbparse\info.py -> build\lib.win32-3.6\pdbparse                                                                                 
  copying pdbparse\omap.py -> build\lib.win32-3.6\pdbparse                                                                                 
  copying pdbparse\pe.py -> build\lib.win32-3.6\pdbparse                                                                                   
  copying pdbparse\peinfo.py -> build\lib.win32-3.6\pdbparse                                                                               
  copying pdbparse\postfix_eval.py -> build\lib.win32-3.6\pdbparse                                                                         
  copying pdbparse\symlookup.py -> build\lib.win32-3.6\pdbparse                                                                            
  copying pdbparse\tpi.py -> build\lib.win32-3.6\pdbparse                                                                                  
  copying pdbparse\undecorate.py -> build\lib.win32-3.6\pdbparse                                                                           
  copying pdbparse\undname.py -> build\lib.win32-3.6\pdbparse                                                                              
  copying pdbparse\__init__.py -> build\lib.win32-3.6\pdbparse                                                                             
  running build_ext                                                                                                                        
  building 'pdbparse._undname' extension                                                                                                   
  creating build\temp.win32-3.6                                                                                                            
  creating build\temp.win32-3.6\Release                                                                                                    
  creating build\temp.win32-3.6\Release\src                                                                                                
  D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\Python36-32\include -ID:\Pytho
6-32\include "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\A
MFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\inc
de\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Fi
s (x86)\Windows Kits\8.1\include\\winrt" /Tcsrc/undname.c /Fobuild\temp.win32-3.6\Release\src/undname.obj                                  
  undname.c                                                                                                                                
  src/undname.c(225): warning C4018: '<': signed/unsigned mismatch                                                                         
  src/undname.c(226): warning C4018: '>=': signed/unsigned mismatch                                                                        
  src/undname.c(358): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable depre
tion, use _CRT_SECURE_NO_WARNINGS. See online help for details.                                                                            
  C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1769): note: see declaration of 'sprintf'                       
  src/undname.c(657): warning C4018: '<': signed/unsigned mismatch                                                                         
  src/undname.c(1535): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprec
ion, use _CRT_SECURE_NO_WARNINGS. See online help for details.                                                                             
  src/undname.c(1530): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable depr
ation, use _CRT_SECURE_NO_WARNINGS. See online help for details.                                                                           
  C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy'                       
  D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:
 /LIBPATH:D:\Python36-32\Libs /LIBPATH:d:\src\python\envs\36-32\libs /LIBPATH:d:\src\python\envs\36-32\PCbuild\win32 "/LIBPATH:D:\Program F
es (x86)\Microsoft Visual Studio 14.0\VC\LIB" "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB" "/LIBPATH:C:\Pro
am Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86" "/LIBPAT
C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" /EXPORT:undname /EXPORT:PyInit__undname build\temp.win32-3.6\Release\src/undnam
obj /OUT:build\lib.win32-3.6\pdbparse\_undname.cp36-win32.pyd /IMPLIB:build\temp.win32-3.6\Release\src\_undname.cp36-win32.lib             
  LINK : error LNK2001: unresolved external symbol PyInit__undname                                                                         
  build\temp.win32-3.6\Release\src\_undname.cp36-win32.lib : fatal error LNK1120: 1 unresolved externals                                   
  error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\link.exe' failed with exit status 1120                   

  ----------------------------------------                                                                                                 
  Failed building wheel for pdbparse                                                                                                       
  Running setup.py clean for pdbparse                                                                                                      
Failed to build pdbparse                                                                                                                   
Installing collected packages: pdbparse                                                                                                    
  Running setup.py install for pdbparse ... error                                                                                          
    Complete output from command d:\src\python\envs\36-32\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sean\\
pData\\Local\\Temp\\pip-build-h6vbtw1u\\pdbparse\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n')
.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\sean\AppData\Local\Temp\pip-daunoe0f-record\install-record.txt --
ngle-version-externally-managed --compile --install-headers d:\src\python\envs\36-32\include\site\python3.6\pdbparse:                      
    running install                                                                                                                        
    running build                                                                                                                          
    running build_py                                                                                                                       
    creating build                                                                                                                         
    creating build\lib.win32-3.6                                                                                                           
    creating build\lib.win32-3.6\pdbparse                                                                                                  
    copying pdbparse\dbgold.py -> build\lib.win32-3.6\pdbparse                                                                             
    copying pdbparse\dbi.py -> build\lib.win32-3.6\pdbparse                                                                                
    copying pdbparse\fpo.py -> build\lib.win32-3.6\pdbparse                                                                                
    copying pdbparse\gdata.py -> build\lib.win32-3.6\pdbparse                                                                              
    copying pdbparse\info.py -> build\lib.win32-3.6\pdbparse                                                                               
    copying pdbparse\omap.py -> build\lib.win32-3.6\pdbparse                                                                               
    copying pdbparse\pe.py -> build\lib.win32-3.6\pdbparse                                                                                 
    copying pdbparse\peinfo.py -> build\lib.win32-3.6\pdbparse                                                                             
    copying pdbparse\postfix_eval.py -> build\lib.win32-3.6\pdbparse                                                                       
    copying pdbparse\symlookup.py -> build\lib.win32-3.6\pdbparse                                                                          
    copying pdbparse\tpi.py -> build\lib.win32-3.6\pdbparse                                                                                
    copying pdbparse\undecorate.py -> build\lib.win32-3.6\pdbparse                                                                         
    copying pdbparse\undname.py -> build\lib.win32-3.6\pdbparse                                                                            
    copying pdbparse\__init__.py -> build\lib.win32-3.6\pdbparse                                                                           
    running build_ext                                                                                                                      
    building 'pdbparse._undname' extension                                                                                                 
    creating build\temp.win32-3.6                                                                                                          
    creating build\temp.win32-3.6\Release                                                                                                  
    creating build\temp.win32-3.6\Release\src                                                                                              
    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\Python36-32\include -ID:\Pyt
n36-32\include "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-ID:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
TLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\i
lude\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program 
les (x86)\Windows Kits\8.1\include\\winrt" /Tcsrc/undname.c /Fobuild\temp.win32-3.6\Release\src/undname.obj                                
    undname.c                                                                                                                              
    src/undname.c(225): warning C4018: '<': signed/unsigned mismatch                                                                       
    src/undname.c(226): warning C4018: '>=': signed/unsigned mismatch                                                                      
    src/undname.c(358): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable dep
cation, use _CRT_SECURE_NO_WARNINGS. See online help for details.                                                                          
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\stdio.h(1769): note: see declaration of 'sprintf'                     
    src/undname.c(657): warning C4018: '<': signed/unsigned mismatch                                                                       
    src/undname.c(1535): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable depr
ation, use _CRT_SECURE_NO_WARNINGS. See online help for details.                                                                           
    src/undname.c(1530): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable de
ecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.                                                                         
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\string.h(346): note: see declaration of 'strncpy'                     
    D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUA
NO /LIBPATH:D:\Python36-32\Libs /LIBPATH:d:\src\python\envs\36-32\libs /LIBPATH:d:\src\python\envs\36-32\PCbuild\win32 "/LIBPATH:D:\Program
iles (x86)\Microsoft Visual Studio 14.0\VC\LIB" "/LIBPATH:D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB" "/LIBPATH:C:\P
gram Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86" "/LIBP
H:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" /EXPORT:undname /EXPORT:PyInit__undname build\temp.win32-3.6\Release\src/undn
e.obj /OUT:build\lib.win32-3.6\pdbparse\_undname.cp36-win32.pyd /IMPLIB:build\temp.win32-3.6\Release\src\_undname.cp36-win32.lib           
    LINK : error LNK2001: unresolved external symbol PyInit__undname                                                                       
    build\temp.win32-3.6\Release\src\_undname.cp36-win32.lib : fatal error LNK1120: 1 unresolved externals                                 
    error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\link.exe' failed with exit status 1120                 

    ----------------------------------------                                                                                               
Command "d:\src\python\envs\36-32\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sean\\AppData\\Local\\Temp\\pi
build-h6vbtw1u\\pdbparse\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(
de, __file__, 'exec'))" install --record C:\Users\sean\AppData\Local\Temp\pip-daunoe0f-record\install-record.txt --single-version-externall
managed --compile --install-headers d:\src\python\envs\36-32\include\site\python3.6\pdbparse" failed with error code 1 in C:\Users\sean\App
ta\Local\Temp\pip-build-h6vbtw1u\pdbparse\                                                                                                 
Sinderella commented 7 years ago

I recently got the same error as you do. I followed the quick hack at the URL below and it's working fine. https://countchu.blogspot.co.uk/2014/09/use-python-pdbparse-to-parse-pdb-files.html

By adding the following snippet to the undname.c file.

char *init_undname(char *buffer, char *mangled, int buflen, unsigned short int flags)
{
  return undname (buffer, mangled, buflen, flags);
}
seanlis commented 7 years ago

thanks for the info :)