I'm trying to deploy my Django website, which is written using Python 2.7, on a windows 64 bit machine (Windows Server 2008 R2). I installed the pre-compiled version of Apache (Apache 2.4.16 x64) from https://www.apachehaus.com/cgi-bin/download.plx (due to lack of option provided by Apache Lounge***), and have checked that Python 2.7 runs on 64 bit and compiles with VC9. I wasn't able to find a pre-built binary for mod_wsgi (for Windows 64 bit and compiled with VC9), so I downloaded the source code for mod_wsgi from https://github.com/GrahamDumpleton/mod_wsgi/releases/tag/4.4.13 and followed the direction from https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst, changing the ap24py27-win64-VC9.mk file to point at the right directories for APACHE_ROOTDIR and PYTHON_ROOTDIR, and using C++ 2008 64-bit Command Prompt to run the command nmake -f ap24py27-win64-VC9.mk clean. However, this gave me the error:
wsgi_memory.obj : error LNK2019: unresolved external symbol GetProcessMemoryInfo referenced
in function getPeakRSS
mod_wsgi.so : fatal error LINK1120: 1 unresolved externals
NMAKE : fatal error U1077: `"...\Visual C++ for Python\9.0\VC\Bin\amd64\c1.EXE"` :
return code `0x2`
Stop.
I have read the installation and configuration documents for mod_wsgi multiple times and have searched the web including SO for the past few hours to no avail. What am I doing wrong here and how could I fix it?
***I know the official document for installing mod_wsgi warns against using binaries from other sources than Apache Lounge but I don't seem to be able to find the right compiled version (for VC9 and Windows 64 bit) from the site. Could this be a problem and if so, how could I fix it?
Update: following Adelin's suggestion, I was able to get namke -f ap24py27-win64-VC9.mk clean to run. However, when I try running namke -f ap24py27-win64-VC9.mk or namke -f ap24py27-win64-VC9.mk install, I get pages of warnings that say: warning C4820: '...' : '...' bytes padding added after data member '...' until the compiler quits with
fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
...\mod_wsgi-4.4.13\src\server\wsgi_memory.c<124> : warning C4711: function 'getCurrentRSS' selected for automatic inline expansion
NMAKE: fatal error U1077: '"C:\...\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\c1.EXE"' : return code '0x2'
Stop.
Does anyone have any idea why this might be and how I should go about fixing it?
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:
Locate psapi.lib (run a search on C:\)
Open the ap24py27-win64-VC9.mk file you are using to compile, with
any text editor
See what other .mk file it includes. Most probably common-VC9.mk
Open that file (common-VC9.mk) with any text editor
Under LDFLAGS, append yet another line of /LIBPATH:"PATH_FOUND_AT_STEP_1"\
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.
Related
I'm working with Houdini HDK (API), when I include
#include<OP/OP_OperatorTable.h> or some other preprocessor i get the error message
the visual studio gives me this error, C++ cannot open source file "hboost/predef/os/cygwin.h
the full error message is: Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file "hboost/predef/os/cygwin.h" NodeCreation C:\Program Files\Side Effects Software\Houdini 17.5.467\toolkit\include\hboost\predef\os.h
After I see this message for the first time I thought I should install Cygwin for windows, and I install the Cygwin but I get the error again
there's no cygwin.h file in this path, visual studio is searching for this file in this path
what's the problem and what should I do?
If you dont have cygwin.h that means you miss something when you install the Houdini API. I try a FULL installation by checking ALL the buttons below:
At the end, you will have this in your installation folder :
I am unable to tell you which one is responsible for installing "cygwin.h" but that should solve your problem.
I'm following this guide on building V8 but I am hitting some issues on the compilation step. I am running Windows 10 x64. I am trying to compile with options to embed the engine also.
Running the following command:
ninja -C out.gn/x64.release
Gives me this error:
ninja: Entering directory `out.gn/x64.release'
[1/471] LINK mksnapshot.exe mksnapshot.exe.pdb
FAILED: mksnapshot.exe mksnapshot.exe.pdb
C:/Workspace/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./mksnapshot.exe /PDB:./mksnapshot.exe.pdb #./mksnapshot.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'comdlg32.lib'
ninja: build stopped: subcommand failed.
Now I believe I have narrowed down the error to looking for the .lib files in the wrong directory. I have (had) multiple versions installed, so there were multiple folders in my Windows Kit install.
Windows Kits/10/Lib/10.0.16299.0
Windows Kits/10/Lib/10.0.15xxx.0
If I dragged and dropped the comdlg32.lib file from 10.0.16299.0 into the 10.0.15xxx.0 directory then the error changed to a LNK1181 error with a different input file. I did this a few times but I was unsure if this was going to cause issues with different versions and there was probably going to be a lot.
I uninstalled the 10.0.15xxx.0 version which left behind the folder I mentioned, so I removed that and after doing so I have started getting the LNK1181 error with a different input file (advapi32.lib I assume the very first file it can't find). This is how I came to the conclusion about the path being incorrect.
So I have tried a few things to change the path (I hoped just uninstalling the old version would fix it) such as:
Uninstalling the old version.
Going through registry entries to see if I can find an install path or something using that path, which I didn't. I did notice that there was still installation and data in the registry for the 10.0.15xxx.0 install, I might try deleting that from the registry directly as a last resort?
I have tried to explicitly set the path by setting <TargetUniversalCRTVersion>10.0.16299.0</TargetUniversalCRTVersion> in this file: C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
I have never used Ninja before so I tried looking for a way to set some kind of lib-path in the command but couldn't really find anything.
I looked through the python scripts being executed to try and locate something to do with the libs path but couldn't see anything.
I would be grateful for any help and suggestions. Thanks.
You can try to compile v8 using Visual Studio as explained here: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#using-the-visual-studio-ide
By running the following commands:
$ gn gen --ide=vs out.gn/x64.release
$ cd out.gn/x64.release
$ msbuild all.sln
You can see a full example here: https://github.com/phpv8/v8js/issues/272#issuecomment-262848754
Apparently this method is not officially supported anymore, but I had the same problem as you have and this solved the issue for me.
Note that after this I had another issue, the unit tests failed to be compiled due to a linking error, but I had the necessary libraries to use v8. So there may be deeper problem that is causing all of this that I'm missing.
Edit:
Also, you could try to set the following parameters with gn args:
visual_studio_path = "..."
visual_studio_version = "2017"
wdk_path = "..."
windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"
To set those parameters, do:
gn args out.gn/x64.release
This will open a text editor where you can write the extra parameters you are interested in.
To see the full list of parameters you can specify:
gn args --list out.gn/x64.release
I was following this guide https://medium.com/dailyjs/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4 and also ran into the error
LINK1181: cannot open input file 'advapi32.lib'
I'm pretty sure it was because I had the wrong versions of the Windows 10 SDK. Similar to you I had versions:
Windows Kits/10/Lib/10.0.10240.0
Windows Kits/10/Lib/10.0.16299.0
But according to https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Setting-up-Windows (Which I think is relevant) you need version 10.0.15063.0
After installing version 10.0.15063.0 (with the visual studio installer) to
Windows Kits/10/Lib/10.0.15063.0
I was able to continue with the build.
I have been following the instructions in the OpenSSL User Guide, which links to a guide by 3noch for compiling OpenSSL. Here are the tools/versions I am using:
ActiveState Perl v5.20.2
Microsoft Visual Studio 2012
Netwide Assembler (NASM) v2.12.02
OpenSSL 1.0.2j (source tarball)
Following the instructions, I am able to execute the following commands without issue:
perl Configure VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32
ms\do_ms
Then, when I go on to execute
nmake -f ms\nt.mak
I receive the following
Assembling: tmp32\sha1-586.asm
tmp32\sha1-586.asm(1432) : error A2070:invalid instruction operands
tmp32\sha1-586.asm(1576) : error A2070:invalid instruction operands
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\ml.EXE"' : return code '0x1'
Stop.
After looking into that issue, I found a blog post by HostageBrain that mentions that exact error, stating to use nasm to perform the compiling. So, I switched to this command sequence:
perl Configure VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32
ms\do_nasm
nmake -f ms\nt.mak
However, once switching to the NASM variation, I receive the following errors:
tmp32\sha1-586.asm:1: error: parser: instruction expected
tmp32\sha1-586.asm:2: error: parser: instruction expected
tmp32\sha1-586.asm:3: error: parser: instruction expected
tmp32\sha1-586.asm:4: warning: label alone on a line without a colon might be in error
tmp32\sha1-586.asm:5: warning: label alone on a line without a colon might be in error
tmp32\sha1-586.asm:6: warning: label alone on a line without a colon might be in error
tmp32\sha1-586.asm:7: error: symbol `IF' redefined
tmp32\sha1-586.asm:7: error: parser: instruction expected
tmp32\sha1-586.asm:8: error: parser: instruction expected
tmp32\sha1-586.asm:9: error: comma expected after operand 1
What I am looking for is to be able to compile OpenSSL into .lib files that I can then link to from other C++ projects, such as when compiling FreeTDS.
On the same my blog page which you refer I also describe 'no-asm' case - this case is simpler for compiling (it won't require nasm at all), but drawback is - some algorithms performance will be 2x-4x slower than assembler versions.
If your case can accept this performance - try to compile 'no-asm' case.
perl Configure VC-WIN32 no-asm --prefix=C:\Build-OpenSSL-VC-32
I built the library from a regular command prompt on Windows 10 with VS 2015 with the following commands (debug build shown):
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
perl Configure debug-VC-WIN64A --prefix=C:\Path\to\target\folder
ms\do_win64a
nmake -f ms\ntdll.mak
cd out32dll.dbg
..\ms\test
cd ..
nmake -f ms\ntdll.mak install
I know this is an old post, but for others having the problem with NASM parsing errors, here's the solution:
Once you run either ms\do_ms.bat (to use masm) or ms\do_nasm.bat (to use nasm), you can't just switch to the other one without first clearing out the tmp32 directory, otherwise perl will never regenerate the .asm files correctly. The parser errors you're getting are from nasm trying to assemble a masm-formatted file.
The easiest way to clean out tmp32 is to run "nmake -f ms\nt.mak clean".
Answering to this very old question. There are a couple of problems associated with building it under x64 that way including hitting "assemblers not found", downloading NASM and adding to path etc. There is a very good and simple solution using MSYS2.
Install MSYS2. Ensure you get the toolchain needed (see the guide for pacman). Then follow below steps
$Launch msys2_shell.cmd -mingw64
$wget -c ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/openssl-1.0.2o.tar.gz
$tar -xzvf openssl-1.0.2o.tar.gz openssl-1.0.2o/
$cd openssl-1.0.2o/
$./configure shared mingw64
$make
That's it. In apps directory you will get openssl executable along with the libraries.
-Sreejith. D. Menon
I try to compile a driver for WinXP x86 Release, using these commands:
C:\WinDDK\7600.16385.0\bin\setenv.bat C:\WinDDK\7600.16385.0\ fre x86 WXP no_oacr
cd C:\src
build
It fails because of these U1073 errors about msvcrt_winxp.obj. I checked and there is no msvcrt_winxp.obj file anywhere in C:\WinDDK or its subdirectories.
It looks to me the problem is not in the actual code, but maybe I haven't set up the DDK right before compiling. Why do I get these U1073 errors?
I found this similar question - driver build is failing for amd64 via winddk, but there the OP did has not included relevant information such as his build output, and his question is unanswered. I also found this thread - http://www.techtalkz.com/microsoft-device-drivers/295015-wdk-linker-error-u1073.html, but there is no answer there, as well.
My Build Output:
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\7600.16385.0\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Thu Nov 13 12:04:25 2014
BUILD: Examining c:\src directory tree for files to compile.
c:\src
c:\src\common
c:\src\driver
c:\src\ui
BUILD: Saving c:\winddk\7600.16385.0\build.dat...
1>BUILD: Compiling (NoSync) c:\src\driver directory
2>BUILD: Compiling (NoSync) c:\src\ui directory
_NT_TARGET_VERSION SET TO WINXP
_NT_TARGET_VERSION SET TO WINXP
1>BUILD: Linking for c:\src\driver directory
2>BUILD: Linking for c:\src\ui directory
_NT_TARGET_VERSION SET TO WINXP
_NT_TARGET_VERSION SET TO WINXP
1>errors in directory c:\src\driver
1>NMAKE : fatal error U1073: don't know how to make 'c:\winddk\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj'
2>errors in directory c:\src\ui
2>NMAKE : fatal error U1073: don't know how to make 'c:\winddk\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj'
1>nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2
2>nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2
BUILD: Finish time: Thu Nov 13 12:04:26 2014
BUILD: Done
0 files compiled - 4 Errors
I don't know why, but after I installed an even newer version - 7600.16385.1 from http://www.microsoft.com/en-us/download/details.aspx?id=11800, building worked fine, without any errors.
It didn't work the first time, however, but I noticed it was still complaining about 7600.16385.0, so I removed any intermediary build output, .err and .log files. After compiling again, it worked this time.
I also noticed that msvcrt_winxp.obj was present in c:\WinDDK\7600.16385.1, but not in c:\WinDDK\7600.16385.0.
I must admit that I hadn't downloaded c:\WinDDK\7600.16385.0, it was an old folder I found on my hard-drive, and I assumed I had used it to compile the project before, so I just copied it. The problems might have been because of this.
So in conclusion, the problem was with my WinDDK install, not with the project itself, and installing a newer version fixed it. Maybe re-installing the same version would have worked, too, but I have no need to verify that now that's working with the newer version.
Edit 2 -
I don't have the application file qmake in the /bin folder and this is the error I am getting.
Path environment variable : C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
Command Prompt - visual studio 2005
Source folder - C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4
Steps -
Downloaded src
Extracted the files to folder – qt-everywhere-opensource-src-4.7.4(C:\development\referencebuilds\qt\4.7.4)
configure.exe -opensource -fast -no-accessibility -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-webkit -no-scripttools -platform win32-msvc2005 -D “_BIND_TO_CURRENT_VCLIBS_VERSION=1”
4.nmake
The error I get is
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7
.4\bin\qmake C:/development/referencebuilds/qt/4.7.4/qt-everywhere-opensource-sr
c-4.7.4/\projects.pro -o Makefile -spec win32-msvc2005
'C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
qmake' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\development\referencebuilds\qt\4.7.4\qt-everywher
e-opensource-src-4.7.4\bin\qmake' : return code '0x1'
Stop.
I know I dont have the app files for qmake and many other appfiles in my \bin folder. How do I get them?
Edit 1
Well, after trying out all the answers, the situation still remains the same. I think i should add more details to what I am doing.
I am copying bin files(.dll , Appplication, Application Extension, Incremental Linker File, Program Debug Database, ) from another machine and the version of Qt was 4.7.2
My questions are -
1. Do you see that as the cause for all the issues here? If yes, how do I get all the above files? If I just congigure as above and then run nmake I get
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
C:\development\referencebuilds\qt\4.7.4\bin\qmake
C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile
-spec win32-msvc2008
'C:\development\referencebuilds\qt\4.7.4\bin\qmake' is not recognized
as an inte rnal or external command, operable program or batch file.
NMAKE : fatal error U1077:
'C:\development\referencebuilds\qt\4.7.4\bin\qmake' : return code
'0x1' Stop.
1, Downloaded the source file named
qt-everywhere-opensource-4.7.4 and saved it in folder c:\development\referencebuilds\qt\4.7.4\
2, uncompressed the zip file and the files extracted into folder
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
3, Copied back all files from the folder
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4 to c:\development\referencebuilds\qt\4.7.4\
4, ran
configure.exe -opensource -fast -no-acce ssibility -no-qt3support
-no-multimedia -no-audio-backend -no-phonon -no-phonon- backend
-no-webkit -no-scripttools -platform win32-msvc2008 -D
"_BIND_TO_CURRENT
_VCLIBS_VERSION=1"
5, nmake and now I get the following errors.
C:\development\referencebuilds\qt\4.7.4\bin\qmake
C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile
-spec win32-msvc2008 Could not find mkspecs for your
QMAKESPEC(win32-msvc2008) after trying:
C:\Qt\4.7.2\mkspecs Error processing project file:
C:/development/referencebuilds/qt/4.7.4//projects .pro NMAKE : fatal
error U1077: 'C:\development\referencebuilds\qt\4.7.4\bin\qmake.EX E'
: return code '0x3' Stop.
I have no clue as to why it is refering to C:\Qt\4.7.2\mkspecs . How do I get over this error? what is exactly happening. How do I prevent such issues in future?
Your install directory is:
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
Let's call it $(QTDIR). Now:
Extend your PATH variable to include $(QTDIR)\bin
Specify the QMAKESPEC environment variable to be win32-msvc2005
Open a Visual Studio command prompt to get the Visual Studio environment variables
Run configure
Run nmake
This procedure usually gets the Qt build to work for me.
Make sure that you don't have any existing QT directories in your path before you call configure and nmake.
It looks like you have a previous version of Qt installed. "C:\Qt\4.7.2\". And it would seem you have it setup in your system variables. Look for a variable called QTDIR in your system environment variables. Which is why you are getting an error, basically your 4.7.2 Qt is trying to build the new version.
Two options:
Un-install your old Qt via add/remove software in the control panel.
or
Remove your QTDIR system variable for the time being (will require a re-login) so that when you try to build from source it will use the correct binaries from the source folder.
Then just follow this guide:
http://en.wikibooks.org/wiki/Opticks_Developer_Guide/Getting_Started/Building_Qt_From_Source