开发者

Building mod_helloworld.lpr

开发者 https://www.devze.com 2023-01-21 01:43 出处:网络
Im trying to build the apache example of the mod_helloworld.lpr, C:\\lazarus\\components\\fpweb\\demo\\helloworld\\apache

Im trying to build the apache example of the mod_helloworld.lpr, C:\lazarus\components\fpweb\demo\helloworld\apache

Lazarus 0.9.29

FPC Verion 2.4.3 SVN 27129

i386-win32

After Adding $(LazarusDir)\fpc\2.4.3\source\packages\fcl-web\src\ to the Other Unit Files (-Fu) it will compile, but when i build/link i get the errors

mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterCustomImageList
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterMenuItem
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterMenu
mod_helloworld.lpr(38,1) Error: Und开发者_运维百科efined symbol: WSRegisterMainMenu
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterPopupMenu
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterDragImageList
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterControl
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterWinControl
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterGraphicControl
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterCustomControl
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterScrollingWinControl
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterScrollBox
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterCustomFrame
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterCustomForm
mod_helloworld.lpr(38,1) Error: Undefined symbol: WSRegisterHintWindow
mod_helloworld.lpr(38,1) Fatal: There were 15 errors compiling module, stopping

im gussing its trying to add the lcl or something, but really i have no idea.


Figured it out... it think

after adding Interfaces to the uses cause, i can get the mod_helloworld to compile.

I dont know where that came from, but i remember doing it to get a CGI co compile.

but the problem is now, my apache install will not except the .dll

LoadModule mod_helloworld "C:\lazarus\components\fpweb\demo\helloworld\apache\mod_helloworld.dll"

httpd.exe: Syntax error on line 63 of C:/Program Files/Apache Software Foundatio n/Apache2.2/conf/httpd.conf: Cannot load C:/lazarus/components/fpweb/demo/hellow orld/apache/mod_helloworld.dll into server: The specified module could not be found.

but ill prob post this as a new question soon


I've had the same exact problem under Ubuntu 10.04 LTS amd64.

Have a look at Problem compiling a WebLaz project under Lazarus.

This one might also help: How can I compile a Lazarus Apache module to Apache 1.3, 2.0 and 2.2 selectively?

I took the "delete unnecessary folders" option and forcing fpc.cfg to always point to httpd22.

I know it's not the best so I'll give a more detailed explanation.

Let's assume that FPSRC contains the FPC source files path, FPCUNITS contains the pre-compiled units and FPCCFG contains the path to the fpc.cfg file.

If you have a look at FPCCFG you'll find a block that decides what version of Apache:

#IFDEF FPCAPACHE_1_3
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd13/
#ELSE
#IFDEF FPCAPACHE_2_0
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd20/
#ELSE
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/httpd22/
#ENDIF
#ENDIF

As per suggested here you can put those directives at the top of FPCCFG so the compiler can reach the right folders.

So that takes care of where FPC can find the sources if it needs to compile them.

Now we have another problem: It's doesn't link against the right ppu.

If you have a look at FPCUNITS you'll find 3 folders: httpd13, httpd20 and httpd22.

Now the compiler, while looking for the correct folder/unit combination, will find it first under httpd13, or httpd20. This is no good if you want an Apache 2.2 module and will botch up all the linking.

I don't have a "smart" solution for this dilemma, one that involves conditional directives, so I just deleted the 2 folders I don't want(After a proper backup just in case I need to compile/link against other Apache versions). In my case httpd13 and httpd20.

I've also had to add the "-fPIC" to my compiler options. It was suggested in one of the error messages from either the compiler or the linker, but this is the only thing I REALLY DON'T KNOW if it's a global thing or just my 64bit setup.

I hope this works under Windows though.

EDIT: I'm building a multiple app project and will be using fpmake.pp to compile it all. Once I get all the kinks out of the fpmake.pp I'll also post it so one could avoid some of these issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消