fpc

Type Checking In Pascal

戏子无情 提交于 2021-01-27 04:32:41
问题 I'm just wondering how it's possible to do type checking in pascal? I have been searching for hours now but I haven't been able to find anything useful. Example: var number: Integer; begin write('Enter a number: '); read(number); if {How am I supposed to check if 'number' is an Integer here?} then writeln(number) else writeln('Invalid input') end. 回答1: You are actually hitting the I/O type checking. You can work around this by disabling it temporarily and then checking the result: {$I-} /

防火墙运维监控常用命令之-- Juniper srx系列

爱⌒轻易说出口 提交于 2020-03-12 13:39:15
--------show--- #run show version 查看设备版本 show chassis environment 查看机箱环境 show chassis alarms 查看机箱告警 show log messages 查看日志信息 show chassis fpc 查看机箱fpc信息 show chassis routing-engine 查看机箱路由引擎 --------request------ request system reboot 系统重启 request system halt 系统关机 request chassis fpc slot slot-number offline 板卡下线 request chassis fpc slot slot-number online 板卡上线 来源: 51CTO 作者: tuolzb 链接: https://blog.51cto.com/13001500368/2477598

How can I compile a Lazarus Apache module to Apache 1.3, 2.0 and 2.2 selectively?

别来无恙 提交于 2019-12-23 01:47:07
问题 I've had a look at /etc/fpc.cfg and there is mention to some defines: FPCAPACHE_1_3 FPCAPACHE_2_0 Then in the fcl-web examples there is mention to: Apache1_3 The only one I've found is on the apr.pas on both these files: /usr/share/fpcsrc/2.4.0/packages/httpd20/src/apr/apr.pas /usr/share/fpcsrc/2.4.0/packages/httpd22/src/apr/apr.pas So how does the compiler decide what version of APR to compile? 回答1: If you enable the right one of those conditionals/directives afaik, the rest of the fpc.cfg

Linking FPC .o files into Delphi

▼魔方 西西 提交于 2019-12-22 07:57:10
问题 How can I link a FPC .o from a library to a Delphi executable. When I try to link the following code I get a bunch of unsatisfied forward or external declarations. library project1; {$mode objfpc}{$H+} uses Classes { you can add units after this }; function Test: Integer; begin Result := -1; end; begin end. [dcc64 Error] Project2.dpr(170): E2065 Unsatisfied forward or external declaration: 'INIT$_$SYSTEM' [dcc64 Error] Project2.dpr(170): E2065 Unsatisfied forward or external declaration:

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: Project compiles fine if I only have httpd22 under the Compiled units

Exception raised when setting Text property of TEdit in custom component (Lazarus)

跟風遠走 提交于 2019-12-13 21:00:24
问题 Using: Lazarus 1.2.0; Windows 32-bit application I have created a custom component derived from TCustomPanel and contains some TEdit controls. At runtime, when I try to set the Text property of an edit control in my component, I get a runtime error. This is the error: Project project1 raised exception class 'External: SIGSEGV'. In file '.\include\control.inc' at line 3246: GetTextMethod := TMethod(@Self.GetTextBuf); I Googled and could not find anybody else reporting this error specifically

How to avoid WSRegister* on a Free Pascal .dll/.so

独自空忆成欢 提交于 2019-12-12 23:27:32
问题 I finally had success compiling a "blank" Apache module, but now I've hit a rather annoying snag. I want to communicate with a MongoDB server and I opted for the only lib around for FreePascal/Lazarus, pebongo. Dependency for pebongo is synapse. Somehow I'm getting "/usr/lib/apache2/modules/mod_visius.so: undefined symbol: WSRegisterCustomImageList" when loading my module into Apache. I've tracked down the symbols onto Menus.pp, I think, and lazarusall(something) also plays a role in this.

How do I use CreateFile to access a physical disk?

冷暖自知 提交于 2019-12-12 11:26:51
问题 I asked on the Lazarus programming forum how to open a physical disk. I want to allow the user to select physical disks from their system when they click a "Select Disk" button. There are some examples here at Stack Overflow that are similar but not quite the same (such as Delphi - Using DeviceIoControl passing IOCTL_DISK_GET_LENGTH_INFO to get flash media physical size (Not Partition)). There are lots of C and C++ examples of using CreateFile (in the documentation and especially an example

FPC : RTTI on records

会有一股神秘感。 提交于 2019-12-10 14:37:18
问题 This is my first time on this site. Usually, I have no problem to found replies in the old posts but I don't success with my actual problem. I would like to know how use RTTI functions to know at running time the properties/members of a record under Lazarus/FPC? I know how to do it for a class (Tpersistent descendant and published properties) but not for FPC. Some links indicates how to do it under Delphi (From D2010), but I don't know how to transpose it under Lazarus. Thanks in advance for

How to remove warning: link.res contains output sections; did you forget -T?

眉间皱痕 提交于 2019-12-10 13:52:51
问题 I'm using fpc compiler and I want to remove this warning. I've read fpc's options but I can't find how to do that. Is this possible? it appear when I run command: fpc foo.pas out: Target OS: Linux for i386 Compiling foo.pas Linking p2 /usr/bin/ld: warning: link.res contains output sections; did you forget -T? 79 lines compiled, 0.1 sec 回答1: It's a bug in certain LD versions. Just ignore it for now, or see if your distro has an update for your LD. (package binutils) http://www.freepascal.org