logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


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

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



apxs on windows issue (newbie)

 
Post new topic   Reply to topic    Apache Forum Index -> Apache Building & Member Downloads



View previous topic :: View next topic  
Author Message
alexerwin



Joined: 24 Mar 2009
Posts: 14

PostPosted: Tue 24 Mar '09 3:32    Post subject: apxs on windows issue (newbie) Reply with quote

Hi,

I was following another post that explained how to install the apxs module and to use commands to generate a template apache module. I am attempting to compile it using the instructions and this is occuring. Has this happened to anyone else?

C:\foo>apxs -i -c mod_foo.c
cl /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"Z:\include" /c /Fomod_foo.lo mod_foo.
c
'cl' is not recognized as an internal or external command,
operable program or batch file.
apxs:Error: Command failed with rc=65536
.

Thanks

Alex
Back to top
glsmith
Moderator


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

PostPosted: Tue 24 Mar '09 5:12    Post subject: Reply with quote

Run APSX from the Visual Studio console (vcvars32.bat) see if that helps.
cl.exe is the VC++ compiler/linker
Back to top
alexerwin



Joined: 24 Mar 2009
Posts: 14

PostPosted: Tue 24 Mar '09 6:47    Post subject: I got it working Reply with quote

Hi,

I got it working after copying a great many files. But I am not sure why the following errors are cropping up when try to compile mod_echo.c

C:\>apxs -i -c C:\echo\mod_echo.c
cl /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"Z:\include" /c /FoC:\echo\mod_echo.lo
C:\echo\mod_echo.c
mod_echo.c
link kernel32.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"z:\lib" /out:C:\echo\mod_
echo.so C:\echo\mod_echo.lo
Creating library C:\echo\mod_echo.lib and object C:\echo\mod_echo.exp
mod_echo.lo : error LNK2019: unresolved external symbol __imp__apr_palloc@8 referenced in function
_create_echo_server_config
mod_echo.lo : error LNK2019: unresolved external symbol __imp__apr_brigade_destroy@4 referenced in
function _process_echo_connection
mod_echo.lo : error LNK2019: unresolved external symbol __imp__ap_pass_brigade@8 referenced in func
tion _process_echo_connection
mod_echo.lo : error LNK2019: unresolved external symbol __imp__ap_get_brigade@24 referenced in func
tion _process_echo_connection
mod_echo.lo : error LNK2019: unresolved external symbol __imp__apr_bucket_flush_create@4 referenced
in function _process_echo_connection
mod_echo.lo : error LNK2019: unresolved external symbol __imp__apr_brigade_create@8 referenced in f
unction _process_echo_connection
mod_echo.lo : error LNK2019: unresolved external symbol __imp__ap_hook_process_connection@16 refere
nced in function _register_hooks
C:\echo\mod_echo.so : fatal error LNK1120: 7 unresolved externals
apxs:Error: Command failed with rc=6291456

I am compiling mod_echo with no changes to the code. all of the include files are in the directory. (I think)
Back to top
glsmith
Moderator


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

PostPosted: Tue 24 Mar '09 8:01    Post subject: Reply with quote

skip apsx ..

try:
change C:\Apache2 to where ever your installed Apache top directory is (not the source).
each one of these is a single line the BB is wrapping, so I have seperated single lines with a blank line

in the VC console cd to the module source.

Code:
cd\httpd-2.2.11\modules\echo

cl /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"C:\Apache22/include" /c /Fomod_echo.obj mod_echo.c

link kernel32.lib "C:\Apache22\lib\libhttpd.lib" "C:\Apache22\lib\libapr-1.lib" "C:\Apache22\lib\libaprutil-1.lib" /nologo /subsystem:windows /dll /machine:I386 /out:mod_echo.so mod_echo.obj

copy mod_echo.so c:\Apache2\modules


FYI:

The apr_x_x issues tell me that the APR library needs to be linked in. So, to save from tracking them down just throw both APR libraries at it, libapr-1.lib and libaprutil-1.lib. The ap_X_X tells me libhttpd library needs to be linked so we'll throw that at it as well.

Either APSX is failing at this or maybe you should have tried it from /httpd-2.2.11/modules/echo since you may not have copied all the files you needed, nor is it looking in the right place for them. Dunno .. I've not used apsx but once.
Back to top
alexerwin



Joined: 24 Mar 2009
Posts: 14

PostPosted: Wed 25 Mar '09 9:17    Post subject: Apache cant find the module Reply with quote

That worked and I got a helloworld example to compile (mod_echo came back with link errors). Now Apache doesnt recognize that the module is there though. I am starring right at it. Its in the modules directory that all the other modules are in. I am using LoadModule Helloworld_Module modules/mod_helloworld.so . I set the permissions to list,read,read and execute for the folder and set read and execute on the .so file.

Apache is telling the event logger that it cant find the file. I rebooted to see if that helped and no dice. I would expect that if Apache just didnt like the file that it would complain about something better than not finding it.

I used the code from http://www.cb1inc.com/2007/12/24/creating-a-hello-world-apache-module-with-kdevelop-on-ubuntu because all the rest of the examples were overly complex.

Thanks

Alex
Back to top
glsmith
Moderator


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

PostPosted: Wed 25 Mar '09 18:24    Post subject: Re: Apache cant find the module Reply with quote

alexerwin wrote:
I would expect that if Apache just didnt like the file that it would complain about something better than not finding it.


One would think but that is not the case

You say you got errors compiling mod_echo. I find that strange since I did not get any. However, you may not have cleaned up your prior attempts mess and it was grabbing onto on those files, which will cause error, don't know.

mod_echo I compiled before posting those instructions (took a couple tries to get it right) is here


http://www.justmyspace.org/mod_echo.zip
Back to top
glsmith
Moderator


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

PostPosted: Wed 25 Mar '09 19:44    Post subject: Reply with quote

-read that wrong-
Back to top
alexerwin



Joined: 24 Mar 2009
Posts: 14

PostPosted: Wed 25 Mar '09 22:10    Post subject: Read about a Apache2_0 option Reply with quote

Does this need to be included in the preprocessor? Every single attempt to create a module results in Apache saying it is unable to find the module.
Back to top
glsmith
Moderator


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

PostPosted: Thu 26 Mar '09 7:06    Post subject: Reply with quote

but you did get hello world to compile and load, or it compiled but does not load?

What version of VC are you using.
Any SDK?
Where are source files coming from?
I'm having you use a prebuilt Apache for includes and libs, this might be a mistake if this Apache you did not compile (possible compiler version differences).

I compile my own so I tend to forget to think about the fact that you might not have. I can see room for problems trying to compile against ASF using VC++ > 6. I am also a VC6 junky so I forget about manefest's as well ..

if you see a manifest file

MT -manifest mod_echo.so.manifest -outputresource:mod_echo.so;2

my mod_echo was a VC6 version
Back to top
alexerwin



Joined: 24 Mar 2009
Posts: 14

PostPosted: Thu 26 Mar '09 15:32    Post subject: Versions Reply with quote

I got the hello world to compile but not load. I tried to compile mod_example, mod_echo, and mod_foo and I get all of them to compile with no errors! But apache does not like them. The mod_echo you sent does work though. Maybe I need duplicate your enviornment, but logically that makes no sense.

I am using VC++ 2008 Express
I am using Latest Windows SDK
I am using the source from Apache.org

I have VC++ 6. I am not sure if these factors play in, but: The link on apache.org to 2.2 source binaries for windows kept taking me to 404 on all mirrors, so I download 2.0 binary source, but the target is a 2.2 installation; I used VC++ 2000 Express; I am on a Windows 2K3 Server as target in a dedicated hosted enviornment; I have not attempted to compile on a local machine; I have three local boxes, but only one has VC 6 and its on W2K.
Back to top
glsmith
Moderator


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

PostPosted: Thu 26 Mar '09 19:00    Post subject: Reply with quote

" 2.0 binary source, but the target is a 2.2 installation"
This is problematic as well, they are two separate creatures. Two different versions of APR as well.

so .. apache.org builds are VC6, if you are going to build modules for Apache Software Foundation's (ASF) distribution you may still be able to use VC9 on your modules, I have not given that a try. However, if you are building them VC9 on one machine then trying to load them onto the server, does the server have the 2008 redistributable?

That or build on 6 since you have it.

I used:

VC6
SDK 2003 R2


I see the problem with the links on ASF's page, they are for the old source dist, the next day a revised package came out but links were never changed.

Source's

http://www.apache.org/dist/httpd/httpd-2.2.11-win32-src-r2.zip
http://mirror.jimbojay.com/apache/httpd/httpd-2.2.11-win32-src-r2.zip
http://mirrors.enquira.com/apache/httpd/httpd-2.2.11-win32-src-r2.zip
http://mirrors.24-7-solutions.net/pub/apache/httpd/httpd-2.2.11-win32-src-r2.zip
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache Building & Member Downloads
Page 1 of 1