logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4 linker errors on windows using VS 2008
Author
SolidSnakeGTI



Joined: 16 May 2012
Posts: 16

PostPosted: Wed 16 May '12 21:21    Post subject: Apache 2.4 linker errors on windows using VS 2008 Reply with quote

I've tried to compile Apache HTTP Server 2.4 on windows using Visual Studio 2008 Professional on Windows 7 Service Pack 3, but with no hope at all!!
Already tested same steps with Apache HTTP Server 2.2 and had successful build process.

I don't know what's wrong, or what's missing. Here it is followed steps:

Code:
Visual Studio 2008 Command Prompt:

"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"

cd C:\path\to\httpd-2.4.2
   
perl srclib\apr\build\lineends.pl
   
perl srclib\apr\build\cvtdsp.pl -2005
   
cd srclib\zlib
nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF -I." OBJA="inffas32.obj match686.obj"
MT -manifest zlib1.dll.manifest -outputresource:zlib1.dll;2
   
cd ..\..\srclib\openssl
perl Configure VC-WIN32 enable-camellia disable-idea
ms\do_nasm
nmake /f ms\ntdll.mak
   
Open Apache.dsw with VS9 "Yes to All" to the "convert projects" question, Select relase win32
Now build InstallBin
Test your build


Required libraries already in place:
Code:
    srclib\apr
    srclib\apr-iconv
    srclib\apr-util
    srclib\openssl
    srclib\pcre
    srclib\zlib


As I said, all Apache HTTP Server 2.2 compilations are successful, while all Apache HTTP Server 2.4 is NOT.

This is the most occuring error, repeated over 100 times:

Code:
fatal error LNK1181: cannot open input file '..\..\release\libhttpd.lib'


Other errors:
Code:
    fatal error LNK1181: cannot open input file '..\release\mod_proxy_balancer.lib'
    fatal error LNK1181: cannot open input file '..\core\release\mod_watchdog.lib'
    fatal error C1083: Cannot open include file: 'pcre.h': No such file or directory   
    fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\devenv.COM"' : return code '0x1'
    error PRJ0019: A tool returned an error code from "Performing Makefile project actions"



Any suggestions?

Environment: Windows 7 | Visual Studio 2008 | Cygin | Apache HTTP Server 2.4 Source | APR/APR-UTIL/APR-ICONV/ZLIB/OPENSSL


Note: I've noticed that there's multiple .mak file missing from the Apache 2.4 package, including the httpd.mak & others. I think that's big part of the problem.

Question: Is there any manual/steps on how to build Apache for windows? The official documentation isn't sufficient. Or can I ask how do you build it yourself here @ Apache Lounge?


Last edited by SolidSnakeGTI on Wed 16 May '12 23:25; edited 1 time in total
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 16 May '12 22:49    Post subject: Reply with quote

what is in srclib/pcre?

Unlike 2.2, pcre is not included in the source distribution of 2.4, you have to download it and compile separate like you have with openssl & zlib.

Once compiled, all that needs to be in scrlib/pcre is
pcre.h
pcre.lib
pcre.dll
pcre.pdb

You need CMake to generate the sln/vcproj file
You want to build "shared libraries"
You want to build debug symbols (forgot the option to check)

EDIT: I build pcre in tree since I have project files and a patch to make it work so I haven't built using CMake in a long time. There is no option to check in CMake for the debug symbols, instead it's when compiling in VC9/10 you select the RelWithDebInfo target.

version 8.30 is current version
PCRE source: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

If you wish, feel free to use my vc9 pre-compiled 8.30 binaries to get up and going quicker but definitely get CMake and the source and get used to building it.

https://www.apachehaus.net/pcre/


Last edited by glsmith on Thu 17 May '12 5:55; edited 1 time in total
Back to top
SolidSnakeGTI



Joined: 16 May 2012
Posts: 16

PostPosted: Wed 16 May '12 23:24    Post subject: Reply with quote

Well, to be honest I'm new to VS compiling world, but learning & progressing well!

You mentioned how to fix the PCRE issue, but what about the libhttpd.lib issue?

Note: I've noticed that there's multiple .mak file missing from the Apache 2.4 package, including the httpd.mak & others. I think that's big part of the problem.

Question: Is there any manual/steps on how to build Apache for windows? The official documentation isn't sufficient. Or can I ask how do you build it yourself here @ Apache Lounge?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 17 May '12 0:24    Post subject: Reply with quote

libhttpd will not build if pcre.h/lib is missing.
None of the modules will build if libhttpd or libapr-1 or libaprutil-1.libs is missing.
None of the support programs will build if apr-1.lib or sometimes aprutil-1.lib is missing.

Correct, there are no .mak files for most if not all of it, the .mak files are generated from the .dsp files in VC6. Once they start providing -win32- sources, there may be .mak files throughout only those packages, or .sln/.vcproj files. The .mak files are only for building at the command line, and I have been building for years and prefer the IDE.

I have VC6 and could probably generate some .mak files for you if you really wanted.

They wanted to do away with the .dsp/dsw files but I and a few others screamed a loud NO!

As far as building instructions, have you googled? I have some from when 2.4 was still 2.3 in beta, I just haven't gotten around to making changes needed now that it's in 2.4, API is locked, and there is the apr_crypto stuff to deal with.
Back to top
SolidSnakeGTI



Joined: 16 May 2012
Posts: 16

PostPosted: Thu 17 May '12 11:40    Post subject: Reply with quote

Well your compiled pcre did the trick, I've successfully compiled Apache 2.4, I got only one simple error:
Code:
Error result 1 returned from 'C:\Windows\system32\cmd.exe'.   Project   mod_log_forensic


1. The reason of that error, and what should I do against?
2. How can I compile PCRE myself? I'm trying compiling using cmake but getting the following errors;
Code:
Could NOT find BZip2 (missing:  BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could not find OPTIONAL package Readline


Many thanks for your appreciated assistance..
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 17 May '12 20:56    Post subject: Reply with quote

mod_log_forensic

What is the actual error, would show while that project was compiling.

pcre

On mine it says
Could not find OPTIONAL package BZip2
Could not find OPTIONAL package ZLIB
Could not find OPTIONAL package Readline

So they should all be optional. You have zlib so if you wish you could point it to that;

zlib's source folder is where the headers are to include (ZLIB_INCLUDE_DIR).
zlib.lib is the library to point to for static linking, zdll.lib for dynamic linking* (ZLIB_LIBRARY).

but none are a dependency so you do not have to. If after pushing configure button there are still some in red, just push it again, then the generate button will unlock.

* Static linking will give a larger file but will not have a dependency to the zlib1.dll so it could be shipped without the zlib dll vs. dynamic linking which would need the zlib dll along with it, which is ok when using with Apache since the zlib1.dll must be included in Apache's bin folder anyway for mod_deflate.
Back to top
SolidSnakeGTI



Joined: 16 May 2012
Posts: 16

PostPosted: Tue 26 Jun '12 15:52    Post subject: Reply with quote

I've successfully compiled PCRE 8.30 myself, and compiled Apache 2.4 as well. It's OK now, but as you may know, without lua. Thanks for all of your help, I appreciate it.

I'll be happy to hear from you about the lua issue in the other topic.
Back to top


Reply to topic   Topic: Apache 2.4 linker errors on windows using VS 2008 View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads