| Author |  | 
| FrozenLich 
 
 
 Joined: 22 Nov 2011
 Posts: 3
 
 
 | 
|  Posted: Tue 22 Nov '11 16:28    Post subject: |   |  
| 
 |  
| Hi everybody! 
 Currently, I'm trying to compile httpd (2.2.21-win32) with zlib (1.2.5) and openssl (1.0.0e) under Windows 7 (x64) with Microsoft Visual Studio 10.0 for AMD64.
 
 I want to use the command line cause I want to be able to compile even if there's no Visual Studio installed on my platform.
 
 However, I've tried to follow the instructions for 32-Bit compilation ( http://www.apachelounge.com/viewtopic.php?p=11343 ) as well as for 64-Bit compilation ( http://wiki.apache.org/httpd/Win64Compilation ).
 
 Both lead me to the following error message in the final build step (nmake -f makefile.win installr):
 
  	  | Code: |  	  | Creating library ..\Release\iconv\adobe-stdenc.lib and object ..\Release\iconv\adobe-stdenc.exp adobe-stdenc.obj : error LNK2011: precompiled object not linked in; image may not run
 ..\Release\iconv\adobe-stdenc.so : fatal error LNK1120: 1 unresolved externals
 NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
 \VC\BIN\x86_amd64\link.EXE"' : return code '0x460'
 Stop.
 NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
 \VC\BIN\nmake.exe"' : return code '0x2'
 Stop.
 NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
 \VC\BIN\nmake.exe"' : return code '0x2'
 Stop.
 | 
 
 I also tried to use the solution file. Building the InstallBin project leads to the following build-errors:
 
  	  | Code: |  	  | Error   16   error LNK2011: precompiled object not linked in; image may not run   C:\Win64Compilation\httpd-2.2.21\srclib\apr-iconv\ces\_tbl_simple.obj Error   17   error LNK1120: 1 unresolved externals   C:\Win64Compilation\httpd-2.2.21\srclib\apr-iconv\Release\iconv\_tbl_simple.so
 Error   18   error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.EXE"' : return code '0x460'   C:\Win64Compilation\httpd-2.2.21\srclib\apr-iconv\ces\NMAKE
 Error   19   error MSB3073: The command "NMAKE /nologo /f Makefile.win BUILD_MODE="Win32 Release" BIND_MODE=shared" exited with code 2.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets   38
 Error   25   error LNK2011: precompiled object not linked in; image may not run   C:\Win64Compilation\httpd-2.2.21\srclib\apr-iconv\ccs\adobe-stdenc.obj
 Error   26   error LNK1120: 1 unresolved externals   C:\Win64Compilation\httpd-2.2.21\srclib\apr-iconv\Release\iconv\adobe-stdenc.so   1
 Error   27   error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.EXE"' : return code '0x460'   C:\Win64Compilation\httpd-2.2.21\srclib\apr-iconv\ccs\NMAKE
 Error   28   error MSB3073: The command "NMAKE /nologo /f Makefile.win BUILD_MODE="Win32 Release" BIND_MODE=shared" exited with code 2.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets   38
 Error   29   error MSB6003: The specified task executable "CL.exe" could not be run. The process cannot access the file 'C:\Win64Compilation\httpd-2.2.21\modules\aaa\Release\cl.read.1.tlog' because it is being used by another process.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets   329
 Error   31   error U1077: 'copy' : return code '0x1'   C:\Win64Compilation\httpd-2.2.21\NMAKE
 Error   32   error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe"' : return code '0x2'   C:\Win64Compilation\httpd-2.2.21\NMAKE
 Error   33   error MSB3073: The command "NMAKE /f makefile.win INSTDIR="\Apache22" SHORT=R LONG=Release _install" exited with code 2.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets   38
 | 
 |  | 
| Back to top |  | 
| tdonovan Moderator
 
 
 Joined: 17 Dec 2005
 Posts: 616
 Location: Milford, MA, USA
 
 | 
|  Posted: Wed 23 Nov '11 23:17    Post subject: |   |  
| 
 |  
| One thing to check is that you really did replace all the Makefiles' /MACHINE:X86 link switches per the instructions in the Win64Compilation WiKi page. 
 The Perl expression is case-insensitive:
  	  | Code: |  	  | FOR /R %F IN (*.mak *.mk.win) DO perl -pi.bak -e "s/\/MACHINE:X[0-9]*//gi" %F | 
 It is suspicious that your failure is in the first Makefile which has a lowercase /machine:x86 instead of an uppercase /MACHINE:X86.
 
 Another way to change the Makefiles, if you have SED installed and prefer it to using Perl, is:
  	  | Code: |  	  | FOR /R %a in (*.mak *.dsp *.mk.win) DO sed -i "s=/MACHINE:X86=/MACHINE:X64=ig" %a | 
 FYI - I successfully build 2.2.21 for X64 on Windows 7, using the command-line compiler that comes in the Windows SDK.  I did this:
 Fresh install of Windows 7 Professional
Installed .NET Framework 4 (the C++ compiler requires this)
 Installed the Windows SDK 7.1  (ensure that VC++ is enabled at install)
 Checked that Perl and AWK were in my path
 Zlib 1.2.5
  	  | Code: |  	  | NMAKE -f win32\Makefile.msc AS=ML64 LOC="-DASMV -DASMINF -I." OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" | 
 OpenSSL 1.0.0e
  	  | Code: |  	  | PERL Configure VC-WIN64A disable-idea ms\do_win64a.bat
 NMAKE -f ms\ntdll.mak
 @REM Bug:   OpenSSL 1.0.0e header file is missing for Windows
 COPY crypto\store\store.h  inc32\openssl\
 | 
 HTTPD
  	  | Code: |  	  | FOR /R %a in (*.mak *.dsp *.mk.win) DO SED -i "s=/MACHINE:X86=/MACHINE:X64=ig" %a NMAKE -f Makefile.win USEMAK=1 INSTDIR=C:\Apache2221 _apacher
 NMAKE -f Makefile.win USEMAK=1 INSTDIR=C:\Apache2221 installr
 | 
 Hope this helps,
 -tom-
 |  | 
| Back to top |  | 
| FrozenLich 
 
 
 Joined: 22 Nov 2011
 Posts: 3
 
 
 | 
|  Posted: Thu 24 Nov '11 19:03    Post subject: |   |  
| 
 |  
| Tanks for your reply! 
 I've performed each step as you recommended, but I'm still receiving the same error message. That doesn't make sense at all ...
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Thu 24 Nov '11 20:33    Post subject: |   |  
| 
 |  
| Did you cleaned the source before trying again to compile it aka nmake clean? |  | 
| Back to top |  | 
| Steffen Moderator
 
 
 Joined: 15 Oct 2005
 Posts: 3131
 Location: Hilversum, NL, EU
 
 | 
|  Posted: Thu 24 Nov '11 20:37    Post subject: |   |  
| 
 |  
| And.. did you run cvt.pl -2005 ? 
 
 Steffen
 |  | 
| Back to top |  | 
| FrozenLich 
 
 
 Joined: 22 Nov 2011
 Posts: 3
 
 
 | 
|  Posted: Thu 24 Nov '11 21:13    Post subject: |   |  
| 
 |  
|  	  | James Blond wrote: |  	  | Did you cleaned the source before trying again to compile it aka nmake clean? | 
 Yes, I did.
 
 
  	  | Steffen wrote: |  	  | And.. did you run cvt.pl -2005 ? | 
 I'm sorry, but I have no idea what cvt.pl is.
 
 Why NMAKE is still stating "Win32 Release will be built"?
 |  | 
| Back to top |  | 
| Steffen Moderator
 
 
 Joined: 15 Oct 2005
 Posts: 3131
 Location: Hilversum, NL, EU
 
 | 
|  Posted: Thu 24 Nov '11 23:31    Post subject: |   |  
| 
 |  
| Sorry typo, must be cvtdsp.pl . To find in the apr/build dir. 
 You using the Windows source ?
 
 
 Steffen
 |  | 
| Back to top |  | 
| glsmith Moderator
 
  
 Joined: 16 Oct 2007
 Posts: 2268
 Location: Sun Diego, USA
 
 | 
|  Posted: Fri 25 Nov '11 12:17    Post subject: |   |  
| 
 |  
| Just saying 
 error LNK2011: precompiled object not linked in; image may not run
 
 I have only seen this on Win7 Beta and RC1
 |  | 
| Back to top |  | 
| tdonovan Moderator
 
 
 Joined: 17 Dec 2005
 Posts: 616
 Location: Milford, MA, USA
 
 | 
|  Posted: Fri 25 Nov '11 14:45    Post subject: |   |  
| 
 |  
| A couple more things to check: Did you copy the source directory (C:\Win64Compilation\httpd-2.2.21) from another machine?  or previously use it to build an X86 binary?  If so - make sure you delete all the .obj, .pdb, and (especially!) any .pch files before you build.  In the httpd-2.2.21 directory: Check specifically that these four files don't exist before you start your build: 	  | Code: |  	  | DEL /S *.obj *.pdb *.pch | 
 
 srclib\apr-iconv\LibR\apriconv.pch
srclib\apr-iconv\Release\libapriconv.pch
 srclib\apr-iconv\Release\iconv\ccsiconv.pch
 srclib\apr-iconv\Release\iconv\cesiconv.pch
 Make sure that the environment variables CL and LINK are not set, or if they are set - that they do not contain any switches that you didn't intend to add:
  	  | Code: |  	  | ECHO %CL ECHO %LINK
 | 
 Check that you are using the X64 compiler, not the X86 version.  The command:... should produce output which looks like:
  	  | Quote: |  	  | Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64 | 
 I hope this helps.
 -tom-
 |  | 
| Back to top |  | 
| radix 
 
 
 Joined: 02 Jun 2013
 Posts: 1
 Location: Russia
 
 | 
|  Posted: Sun 02 Jun '13 16:01    Post subject: |   |  
| 
 |  
| srclib\apr-iconv\modules.mk.win: 
 
  	  | Code: |  	  | ...
 all: $(OUTPUT_DIR) $(MODRES).pch $(ALL_TARGETS)
 
 $(OUTPUT_DIR):
 $(SILENT)if not exist "$(OUTPUT_DIR)\$(NULL)" mkdir "$(OUTPUT_DIR)"
 
 $(MODRES).pch:
 $(SILENT)echo #define ICONV_INTERNAL > $*.c
 $(SILENT)echo #include "iconv.h" >> $*.c
 $(SILENT)cl $(ALL_CFLAGS) /Fo$*.obj /Yciconv.h /c $*.c
 .c{$(OUTPUT_DIR)}.so:
 
 ## Added precompiled object $(MODRES).obj below:
 
 $(SILENT)cl $(ALL_CFLAGS) /Fo$*.obj $(MODRES).obj /Yuiconv.h /c $<
 | 
 
 Tested on 2.2.24 x64 builded on VS11 and apr-iconv well works (charset_lite_module).
 |  | 
| Back to top |  |