Install mod_wsgi with Python 2.7 on Windows 64 bit

不打扰是莪最后的温柔 提交于 2019-12-01 20:01:54

I had this same error.

The problem is that the cl.exe doesn't find the psapi.lib. This lib includes the function referenced in wsgi_memory.c - GetProcessMemoryInfo.

To fix this, you should follow these steps:

  1. Locate psapi.lib (run a search on C:\)
  2. Open the ap24py27-win64-VC9.mk file you are using to compile, with any text editor
  3. See what other .mk file it includes. Most probably common-VC9.mk
  4. Open that file (common-VC9.mk) with any text editor
  5. Under LDFLAGS, append yet another line of /LIBPATH:"PATH_FOUND_AT_STEP_1"\
  6. Save changes and retry

What a pain in the ass this was for me too :)

P.S. If you don't find psapi.lib anywhere, it's because you don't have the Windows SDK. I installed both Windows 7 and Windows 8 SDKs and eventually had the psapi.lib located here C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64

Edit: To give you a solution for your newest errors in a somewhat general way, whenever nmake throws "No such file" errors, the location for the file is not properly referenced in common-VC9.mk file.

There are two types of files nmake will look for: .h or .lib.

If a .h is not found, the corresponding path should be properly referenced under the CPPFLAGS variable of common-VC9.mk file. If a .lib is not found, you need to update LDFLAGS path accordingly.

How? The same way you included the path for psapi.lib: locate the file and append the corresponding path to the proper variable: CPPFLAGS or LDFLAGS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!