0

I have mingw and python 2.7 in a Windows 7 box and trying to install PyGraphViz-1.1 using the following CLI utility

python setup.py install build --compiler=mingw32

However, it ends up compiling error with undefined references as follows:

...
build\temp.win-amd64-2.7\Release\pygraphviz\graphviz_wrap.o:graphviz_wrap.c:(.text+0x5a73): undefined reference to '_imp__PyInt_FromLong' 
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

I checked in the link (see here) which suggests exporting definitions from C:\Windows\System32\python27.dll to python27.def and then using dlltool to create libpython27.a and finally placing the libpython.a file under C:\Python27\libs of the Python distribution for MinGW to interpret Python libraries.

I have the C:\MinGW\bin added to my system path and been trying to do the export using

pexports C:\Windows\System32\python27.dll > C:\Windows\System32\python27.def

but each time I am receiving Access is Denied Message.

I did some searching and found that MS Visual Studio users can avail another export option with DUMPBIN but since I don't have MSVS installed, I would like to get some alternative to get rid of the problem and need to use the PyGraphViz-1.1 package. Any suggestions will be very helpful

somnathchakrabarti
  • 3,026
  • 10
  • 69
  • 92
  • 2
    Unless you're running as Administrator, writing to a protected file or directory through the command-line will fail. Either write the `.def` file to a temporary directory and move it with Administrator privileges, or run the command-line as Administrator. –  Jan 09 '13 at 09:34
  • I have been able to export the definitions to python27.def using a non-protected folder under my user account. Thanks for your comments. I thought the problem was with reading the .dll file rather than writing to .def file. Anyway, it was pretty straightforward! – somnathchakrabarti Jan 09 '13 at 10:19

0 Answers0