在Lazarus下编译WebLaz项目时遇到问题 [英] Problem compiling a WebLaz project under Lazarus

查看:132
本文介绍了在Lazarus下编译WebLaz项目时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的规格

  • 操作系统:Ubuntu 10.04 LTS amd64
  • fpc:2.4.0
  • 拉撒路:0.9.28

我试图通过创建一个然后进行编译来编译WebLaz项目. 确定要使用的httpd和fpapache单位时,编译器会以某种方式丢失所有内容.

我在论坛中发现了类似的问题:

尝试了提供的一些解决方案后,我仍然在这一点上:

  1. 如果我在编译单元和包源下只有httpd22,则项目编译正常. las,然后它完全无法链接.

  2. 使用原始的fpc/lazarus文件夹结构(两个HTTPD13,HTTPD20和HTTPD22在位置,单元和源代码上均未更改),编译器抱怨httpd的校验和已更改,并且无法找到fpapache的源代码. /p>

    • 它可以在httpd20下找到httpd.pas,但仅适用于2.2版的文件夹

我完全不知道如何使用WebLaz组件进行编译,我缺少什么?

解决方案

根据我的调查,很冗长的内容是使用编译器选项"上的测试"按钮进行测试的,以下选项均未定义:

  • FPCAPACHE_1_3
  • FPCAPACHE_2_0

所以这意味着在/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

默认情况下,测试将恢复为httpd22.

更是如此:

  1. /usr/lib/fpc/2.4.0/units/x86_64-linux/httpd20
  2. /usr/lib/fpc/2.4.0/units/x86_64-linux/httpd22

在编译器到已编译单元的路径中,这意味着它将首先找到httpd20.

这意味着它将尝试加载2.0版而不是2.2版的已编译单元.

第一个解决方案是从系统中删除/移动1.文件夹.

这将允许您进行编译,但可惜它不会在64位系统上链接(我正在AMD64系统上进行测试,因此我不打算在其他地方使用它.)

该过程以提示结尾,将-fPIC添加到编译器选项中.

如果您要转到Project-> Compiler Options ...-> Other(位于下部文本框),则可以添加它.

Voila,它正在工作.

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:

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?

解决方案

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.

这篇关于在Lazarus下编译WebLaz项目时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆