My specs:
- OS: Ubuntu 10.04 LTS amd64
- fpc: 2.4.0
- lazarus: 0.9.28
I'm trying to compile a WebLaz project just by creating one and then compiling.
Somehow the compiler gets all lost when determinig witch httpd and fpapache Units to use.
I've found similar problems in the forums:
- mod_helloworld.lpr Can't find fpapache Unit ...
- I NEED HELP with fpweb ...
After trying some of the solutions provided there I'm still at this point:
Project compiles fine if I only have httpd22 under the Compiled units and the Source for the packages. Alas it then completely fails to link.
With the original fpc/lazarus folder structure (Having all of HTTPD13, HTTPD20 and HTTPD22 untouched on both locations, units and source) the compiler complains that checksum of httpd has changed and the fails to find fpapache's source.
- It finds httpd.pas under httpd20 but then it only works with folders for 2.2
I'm completely lost as how to compile this using the WebLaz component, what am I missing?
Probably you need to select the version you want, and then rebuild the relevant lazarus parts, so that the pkgs get build with the then selected apache.
Afaik the selection of the httpd daemons is simply changing order, it doesn't mean that all versions are supported at once, like e.g. mysqlconnection does.
From what I could investigate from the, very verbose, output using the Test button on the "Compiler Options" none for these option are defined:
- FPCAPACHE_1_3
- FPCAPACHE_2_0
So this means that in: /etc/fpc.cfg
#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
The test will revert to httpd22 by default.
None the less, having:
- /usr/lib/fpc/2.4.0/units/x86_64-linux/httpd20
- /usr/lib/fpc/2.4.0/units/x86_64-linux/httpd22
in the compiler's path to compiled units it means that it will find httpd20 first.
This means it will try to load the 2.0 version and not the 2.2 version of the compiled units.
So the first solution is to delete/move the 1. folder from the system.
This will let you compile, but alas it will not link on a 64 bit system (I'm testing on a AMD64 system so I'm not going to presume it works elsewhere).
The process ends with a hint, to add -fPIC to the compiler options.
If you go to Project->Compiler Options...->Other on the lower TextBox you can add it.
Voila, it's working.