Problem compiling a WebLaz project under Lazarus

半世苍凉 提交于 2019-12-22 00:53:38

问题


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:

  1. 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.

  2. 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?


回答1:


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.




回答2:


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:

  1. /usr/lib/fpc/2.4.0/units/x86_64-linux/httpd20
  2. /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.



来源:https://stackoverflow.com/questions/3971770/problem-compiling-a-weblaz-project-under-lazarus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!