Open BLutherEUNE opened 4 years ago
looks like _build_ext_library_dirs() is trying to get library dirs out of distutils. I'm wondering if you haven't installed pyd as a python module? in C:\Users\PapaniGe\Desktop\learning\project earth\pydtest
, run python setup.py install
Thanks. So, after setting up the library paths correctly I got rid of that error. I managed to build the hello world examples for both extending and embedding python on windows 7, but I have a problem on windows 10.
In particular for the extending example ( https://pyd.readthedocs.io/en/latest/extend.html ) lld-link complains with stuff like lld-link: error: unknown directive: EXETYPE
. I fixed these by removing all lines except LIBRARY "hello.pyd"
in my python_dll_def.def file, but now I get this error: lld-link: error: subsystem must be defined
. I tried to resolve this by adding /subsystem:widows
and /subsystem:console
using the -L flag in the dmd command that runs behind the scenes, but then I get other linker errors regarding app entry point...
Any idea what to try next? Note that this seems to be a windows 10 issue, I managed to build everything fine on windows 7. Thanks a lot.
I just tried it in win10 and met success. I installed dmd 2.088.1 with the vs2017 build tools. from cmd, I ran
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat
then built and ran examples/hello
python setup.py build
python test.py
which worked, but it did output some warnings:
build\temp.win-amd64-2.7\Release\infra\python_dll_def.def(2) : warning LNK4017: EXETYPE statement not supported for the target platform; ignored
build\temp.win-amd64-2.7\Release\infra\python_dll_def.def(3) : warning LNK4017: SUBSYSTEM statement not supported for the target platform; ignored
build\temp.win-amd64-2.7\Release\infra\python_dll_def.def(4) : warning LNK4017: CODE statement not supported for the target platform; ignored
build\temp.win-amd64-2.7\Release\infra\python_dll_def.def(4) : warning LNK4017: DATA statement not supported for the target platform; ignored
Thanks for the reply. So, one problem I have is that I can't install msvc or the build tools on the windows 10 machine without a license, as this is a corporate machine. I tried installing Windows SDK 7.1, which results in turning the errors into warnings as in your case, but I get a couple of different linker errors afterwards...
Creating library build\lib.win-amd64-2.7\hello.lib and object build\lib.win-amd64-2.7\hello.exp
libcmt.lib(dllcrt0.obj) : error LNK2005: _aenvptr already defined in libcmt.lib(crt0.obj)
libcmt.lib(dllcrt0.obj) : error LNK2005: _wenvptr already defined in libcmt.lib(crt0.obj)
libcmt.lib(dllcrt0.obj) : error LNK2005: __error_mode already defined in libcmt.lib(crt0.obj)
libcmt.lib(dllcrt0.obj) : error LNK2005: __app_type already defined in libcmt.lib(crt0.obj)
libcmt.lib(invarg.obj) : error LNK2019: unresolved external symbol RtlVirtualUnwind referenced in function _call_reportfault
libcmt.lib(gs_report.obj) : error LNK2001: unresolved external symbol RtlVirtualUnwind
libcmt.lib(invarg.obj) : error LNK2019: unresolved external symbol RtlLookupFunctionEntry referenced in function _call_reportfault
libcmt.lib(gs_report.obj) : error LNK2001: unresolved external symbol RtlLookupFunctionEntry
libcmt.lib(chandler.obj) : error LNK2019: unresolved external symbol __imp_RtlUnwindEx referenced in function __C_specific_handler
libcmt.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
libcmt.lib(jmpuwind.obj) : error LNK2019: unresolved external symbol RtlUnwindEx referenced in function _local_unwind
build\lib.win-amd64-2.7\hello.pyd : fatal error LNK1120: 5 unresolved externals
I'll try to figure this out, but meanwhile, if you have an idea why exactly (and which components of) msvc is / are needed for building these extensions (e.g. Cython doesn't need these -- it works fine with just Visual C++ for Python), please let me know. Thanks again!
Hi, I just stared with PyD and I am trying to make it work. I have downloaded the latest release version and unzipped it in my working directory. Also I copied the two files from the documentation (the kind of "hello world" program). I am using windows 10 and python 2.7.12 so I run the command python .\setup.py pydexe but I get the following error
It appears that it tries to add two lists but the one is empty, so it breaks. Any thoughts?