Re: [fpc-pascal] Killing the mail list
I completely agree with that! /Torsten On 15/03/2020 18.34, Alexander Grotewohl wrote: Not that I'm anyone special but I and many others who lurk for the most part would probably just lose track of the project. -- Alexander Grotewohl https://dcclost.com *From:* fpc-pascal on behalf of Michael Van Canneyt *Sent:* Sunday, March 15, 2020 1:09:22 PM *To:* FPC-Pascal users discussions *Subject:* Re: [fpc-pascal] Killing the mail list On Sun, 15 Mar 2020, Jonas Maebe wrote: > On 15/03/2020 14:55, Ryan Joseph via fpc-pascal wrote: >> Has there ever been any discussion into replacing it with a modern web based forum? > > There are web forums if you prefer them to using a mailing list: > https://forum.lazarus.freepascal.org/ (see the forums under the "Free > Pascal" header). > > There are no plans to remove the mailing lists. Indeed, I hope not. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Using docker to build software
Hi List. I am curious to know if there is someone out there that have tried to use Docker (https://www.docker.com) containers to build fpc applications? I have 3 applications in a suite that I am thinking of experimenting with, see if I can create an image containing eg. Ubuntu linux, FPC, Lazarus and dependencies. But if you have tried this before success or not, I would be glad to share thoughts and designs before I embark on my adventure. Best regards, Torsten ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Cross compiling Linux to OS X
Hi all. I recently update from fpc 3.0.0 to 3.0.4 (yes, a little late i know...) for our range of application. In order to simplify our build i have a VM with linux running on it and in there i had it setup to crosscompile fra Linux -> Win32/Win64/Linux32/Darwin-i386. But after the upgrade I can no longer cross-compile the fpc sources to Darwin. I get a linking error that I suspect is related to an old version of binutil (see below for the complete message). Now my question is if there is someone on the list that has a setup where you can successfully build fpc to cross compile from linux -> mac os x. The guide on the wiki is very outdated so there is not a lot of help to get from there. I can still use the build command below on the sources for 3.0.0, so the previous approach i had seems to still be working. Best regards Torsten. === Output == > make distclean crossall crossinstall OPT="-O2 -XX -CX -Xs -Xd -Fl/home/epidata/Apple/SDKs/MacOSX10.5.sdk/usr/lib" CPU_TARGET=i386 OS_TARGET=darwin BINUTILSPREFIX=i686-apple-darwin10- INSTALL_PREFIX=~/fpc FPMAKEOPT="-o -Aas-darwin" lots of lines ... /home/epidata/FreePascal/release_3_0_4/compiler/ppc fpmake.pp -n -Fu/home/epidata/FreePascal/release_3_0_4/packages/fpmkunit/units_bs/x86_64-linux -Fu/home/epidata/FreePascal/release_3_0_4/rtl/units/x86_64-linux -O2 -XX -CX -Xs -Xd -Fl/home/epidata/Apple/SDKs/MacOSX10.5.sdk/usr/lib /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: /usr/lib/libc_nonshared.a(elf-init.oS): in function `__libc_csu_init': (.text+0x2e): undefined reference to `_init' fpmake.pp(47,1) Error: Error while linking fpmake.pp(47,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Undocumented SetLength functionality
Hi All. I just discovered that SetLength(Var S: Array; NewLength: Integer) has an undocumented (appenrently unlimited number of) overloaded functions. Any multi dimentional arrays may be sent to SetLength with appropriate dimension sizes. Making the following possible: program SetArrayLength; var Int2Array: Array of Array of Integer; Int3Array: Array of Array of Array of Integer; // ...etc begin SetLength(Int2Array, 5, 5); SetLength(Int3Array, 5, 5, 5); // ... etc Int2Array[2][2] := 2; Int3Array[2][2][2] := 3; WriteLn(IntArray[2][2]); WriteLn(IntArray[2][2][2]); end; Is this a feature, bug or undocumented behaviour? Afair, this was allowed back in Delphi7 (which is where i copied some of my old code from), but i'm not sure whether it was documented. At least the current RTL documentation on SetLength does not include other variants than the one with just a single length specifier. https://www.freepascal.org/docs-html/rtl/system/setlength.html Best regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Copy dynamic array
Hi List. This i a real newbie question: I hardly use dynamic array, so I don't know if there is a simpler method to copying a dynamic interger array than the straigh forward method: (I need a copy to preseve the current values of OldArray, since OldArray will change values later in the program) SetLength(NewArray, Length(OldArray)); for i := Low(OldArray) to High(OldArray) do NewArray[i] := OldArray[i]; Best regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Lazarus Mailing list down?
Hi All. I haven't gotten any mails on the Lazarus mailing list since 31/03-2018 - and the two mails I sent today doesn't seem to have gone through. Kind regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] TInifile does not handle " " (space) as a value.
Dear List. I was trying to use the ini file for our program to store a single space " " as a value, but this does not seem to be posible. From the Wikipedia definition of INI file (https://en.wikipedia.org/wiki/INI_file#Whitespace) whitespace in values does not seem to be well defined, so it may just be a design choice. The following illustrates the issue: program Project1; {$mode objfpc}{$H+} uses Classes, IniFiles; var Ini: TIniFile; S: String; begin Ini := TIniFile.Create('/tmp/test.ini'); Ini.WriteString('sec1', 'S', ' '); Ini.Free; Ini := TIniFile.Create('/tmp/test.ini'); S := Ini.ReadString('sec1', 'S', 'ZZ'); // S is '' and not ' ' as expected Ini.Free; end. Is this considered a bug or "by design"? Kind regards Torsten Bonde Christiansen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Partial text search in a dictionary
On 2017-05-16 10:26, leledumbo via fpc-pascal wrote: However i would like to be able to do a partial text search on the strings, prefeably with a result as a list of matching string/object pairs but getting an index to the first matching pair would be fine. The match only has to be done from the first character of both strings, so a complex solution like Regex search is not needed. Google for prefix tree (or radix tree or trie) implementation. I believe I've seen one in either Blaise Pascal Magazine or Pascal Gamer Magazine, the topic is about building autocomplete combobox if I'm not mistaken. Exactly... couldn't remeber the name of the trees... :) thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Partial text search in a dictionary
Hi list. I am looking for a class/list/map... that allows me to store string data paired with an object. However i would like to be able to do a partial text search on the strings, prefeably with a result as a list of matching string/object pairs but getting an index to the first matching pair would be fine. The match only has to be done from the first character of both strings, so a complex solution like Regex search is not needed. I know i can use a sorted TStringList with a straight forward search method, however I was hoping someone might know of an implementation that works more or less out of the box. Kind regards Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] server down?
On 2016-10-17 17:28, Mattias Gaertner wrote: Hi, On the bug tracker login page http://mantis.freepascal.org/login_page.php?return=%2Fmy_view_page.php%3F I see this text: Do you already have a login at Free Pascal Community? You can use that login here (use your e-mail address as username). When clicking on the "Free Pascal Community" link it times out: http://community.freepascal.org:1/ BTW, the bugs.freepascal.org site nowhere mentions a webmaster. Mattias I can get access using http://bugs.freepascal.org without any problems... -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] RTF writer
Hi List. I am looking for at component that can write RTF format, preferably like the TRichMemo: http://wiki.lazarus.freepascal.org/RichMemo but without the need for LCL. In fpc 3.0 there is a RTF reader, but i have not been able to find a writer. Kind regards, Torsten ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Single threaded application on multicore CPU
On 2016-06-22 09:02, LacaK wrote: Hi *, may be that this question is bit off-topic here, but I am sure, that here are experts, which know answer ;-) I have simple Lazarus/FPC application (with no explicit threads) which does intensive calculations (local thresholding with big window size) on image, which is stored into memory as 2D byte array. (so only memory access is done and some integer calculations) When I run this application and look at Task Manager or Resource Monitor I see, that all 4 cores "are used" (at least performance graph shows usage or in other words activity in graph increasees) Total CPU usage is <= 25% (which points out to fact, that only 1/4 cores is used) Why this ? As far as I expect, that single threaded application should use only one core, so I would expect activity only on one core not on all four cores (I know that in theory CPU can switch single thread between cores, but I doubt that this is case (as switching has extra cost)... or is ?) Nailed it right there All modern CPU automatically swaps running threads (unless affinity is set) to other cores in case there is a high load. This is done from a heat perspective, since running on a single cores will make a local heat spot on the dye - a things which is not prefered and also not really cost effient. (Btw: When I set affinity to only one core, then this core is 100% and others are 0% as expected) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC 3.0 using clang for cross compile
On 2016-06-14 15:34, Jonas Maebe wrote: Torsten Bonde Christiansen wrote: Is there a reason why fpc needs the llvm for cross compiling (I'm building agains OSX 10.5) - it was not need for fpc 2.6.4... http://wiki.freepascal.org/User_Changes_3.0#Default_assembler_for_Darwin.2Fi386.2Fx86_64.2FARM_and_iPhoneSimulator.2Fi386.2Fx86_64 Thanks - i really should start to read better up on those change notes in future releases ;) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC 3.0 using clang for cross compile
Hi List. I just recently tried to update the build system for our products in order to use fpc 3.0, but found that when i try to make the cross-compiler for Mac OS, it reports an error on missing: /home/epidata/FreePascal/release_3_0_0/compiler/ppcross386 -dNOMOUSE -Ur -dFPC_USE_LIBC -Tdarwin -Pi386 -XPi686-apple-darwin10- -Xr -XX -CX -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix -Fi../bsd -Fi../bsd/i386 -Fi../darwin/i386 -FE. -FU/home/epidata/FreePascal/release_3_0_0/rtl/units/i386-darwin -O2 -XX -CX -Xs -Xd -Fl/usr/lib/apple/SDKs/MacOSX10.5.sdk/usr/lib -di386 -dRELEASE -Us -Sg ../bsd/system.pp system.inc(1824,8) Warning: Implicit string type conversion from "RawByteString" to "UnicodeString" system.pp(361) Error: Assembler *i686-apple-darwin10-clang* not found, switching to external assembling system.pp(361) Fatal: There were 1 errors compiling module, stopping Is there a reason why fpc needs the llvm for cross compiling (I'm building agains OSX 10.5) - it was not need for fpc 2.6.4... In case it is needed, have anyone successfully made a cross compiler from Linux 64-bit to Mac OS? Kind regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Parser Generator
On 2016-05-20 10:40, Carlo Kok wrote: On 2016-05-19 13:10, Torsten Bonde Christiansen wrote: Hi. I am currently looking into integrating a custom language parser into my program and have been searching the web for parser generators that can create Pascal code from a custom language. So far in my search i have found the following "options": * GOLD Parser: http://www.goldparser.org/ Was last updated in sept. 2012 and the lastest pascal implementation is not for the lastest version of the program! * COCO/R: http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/ Same as with the GOLD parser - last updated in 2014 and lastest pascal implementation is for an older version of the program. * TP Yacc/Lex: (included in Free Pascal) Is included with Free Pascal, but the generated code is non-OO, and seems to rely on text-files for input. So if there is anyone out there who knows of such a generator I would be glad to know. It's been my experience that all the compiler compilers have one or more flaws that make it more work in the end to use them than to just write a parser by hand. Previously I have worked with TP Lex/Yacc and it works fine with limitations it has. And yes, using a parser generator is not a magic wand that creates code to run without modification, but on most occations I find that the post-processing required with this approach is far less than writing my own parser. kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Parser Generator
On 2016-05-20 10:58, Marc Santhoff wrote: On Fr, 2016-05-20 at 10:53 +0200, Marc Santhoff wrote: There are some tools I liked very much when dealing with language translation in the past, but they don't fit her. None of them generates ^e "they don't fit here." Fatal typo. I know Torsten is not a girls name. Marc :) Thanks! -Torsten ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Parser Generator
Hi. I am currently looking into integrating a custom language parser into my program and have been searching the web for parser generators that can create Pascal code from a custom language. So far in my search i have found the following "options": * GOLD Parser: http://www.goldparser.org/ Was last updated in sept. 2012 and the lastest pascal implementation is not for the lastest version of the program! * COCO/R: http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/ Same as with the GOLD parser - last updated in 2014 and lastest pascal implementation is for an older version of the program. * TP Yacc/Lex: (included in Free Pascal) Is included with Free Pascal, but the generated code is non-OO, and seems to rely on text-files for input. So if there is anyone out there who knows of such a generator I would be glad to know. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Writing floating points to steams
On 2016-01-13 10:40, Mark Morgan Lloyd wrote: Torsten Bonde Christiansen wrote: On 2016-01-13 10:06, Mark Morgan Lloyd wrote: Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? Depends on size constraints. In the simple case you should convert float to locale-independent string value (no spaces, no commas separators) then write it. If the size does matter, you may convert float to corresponding byte array then write it. Can I ask a naive question here please: does a binary stream store endianness anywhere? In other words, is there any indication that something running on ARM is about to get into trouble by reading something written by (big-endian) MIPS? Not that I'm aware of - i would think of it as a stream of bytes. Endianess is defined by the CPU not by the file. Thanks, I assumed that was the case but thought it worth checking. I suppose that one could stream variants, i.e. the enumeration saying what one was followed by a value. Should writing binary floating point to a stream note that it's IEEE format, just in case anybody ever tries to process it on a platform that supports alternatives? It would be great if storing floating point could be in IEEE, to have a standard as reference. I'm not at all sure about this, but I think I've seen something that suggested that byte ordering in external representations was covered by the standard. I'm not even sure how (or even if) TStream decendants handles endianness for integers I'm guessing they are not. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Writing floating points to steams
On 2016-01-13 10:06, Mark Morgan Lloyd wrote: Serguei TARASSOV wrote: On 13/01/2016 08:47, fpc-pascal-requ...@lists.freepascal.org wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? Depends on size constraints. In the simple case you should convert float to locale-independent string value (no spaces, no commas separators) then write it. If the size does matter, you may convert float to corresponding byte array then write it. Can I ask a naive question here please: does a binary stream store endianness anywhere? In other words, is there any indication that something running on ARM is about to get into trouble by reading something written by (big-endian) MIPS? Not that I'm aware of - i would think of it as a stream of bytes. Endianess is defined by the CPU not by the file. Should writing binary floating point to a stream note that it's IEEE format, just in case anybody ever tries to process it on a platform that supports alternatives? It would be great if storing floating point could be in IEEE, to have a standard as reference. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Writing floating points to steams
On 2016-01-12 12:38, Michael Van Canneyt wrote: On Tue, 12 Jan 2016, Torsten Bonde Christiansen wrote: On 2016-01-12 12:04, Graeme Geldenhuys wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? I use FloatStr() to do the conversion, then Write() to actually write it to a stream. Regards, - Graeme - In my case I am trying to write a datetime value, and in order not to worry about the format, separators, etc. i would much rather just write the actual floating point value... Format the date/time as RFC3339 or ISO 8601 (they differe in details only) and you should not have a problem. ScanDateTime from strutils will happily perform the opposite operation. I will give it a try. But out of curiosity is there a reason why there are not floating point Read/Write methods for TStream (and decendants)? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Writing floating points to steams
On 2016-01-12 12:04, Graeme Geldenhuys wrote: On 2016-01-12 10:45, Torsten Bonde Christiansen wrote: Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? I use FloatStr() to do the conversion, then Write() to actually write it to a stream. Regards, - Graeme - In my case I am trying to write a datetime value, and in order not to worry about the format, separators, etc. i would much rather just write the actual floating point value... Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Writing floating points to steams
Hi all. What is the best/preferred way to write floatingpoint to a steam? Since TStream doesn't have any native WriteFloat/Double and the likes, some conversion is needed - but what is a good strategy for this? A simple conversion like Stream.WriteDWord( DWord(variable>)) is not possible due to illegal type conversion. Any help appriciated. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Generic with inheritance - fpc 3.0
Hi. The docs for 3.0 does not directly mention generics and inheriting from another generic class, but I tried out with the code below. It compiled, ran and worked fine but since the docs do not explicit mention it as a posibility I am a little reluctant to go forward using this strategy if is not meant to work... (ps. i know this is incomplete code, but it should illustrate my point)type type { TMyType } generic TMyType = class private Item: T; public constructor Create; virtual; end; { TMyDerivedType } generic TMyDerivedType = class(specialize TMyType) private Count: Integer; public constructor Create; override; end; TMyIntClass = specialize TMyDerivedType; [...snipped both Create implementations...] var IC: TMyIntClass; begin M := TMyIntClass.Create(); M.Item := 20; M.Count := 2; M.Free; end; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] OpenSSL
On 2015-11-18 13:32, Joost van der Sluis wrote: Op 18-11-15 om 08:00 schreef Torsten Bonde Christiansen: On 2015-11-17 18:25, Serguei TARASSOV wrote: On 17/11/2015 15:24, fpc-pascal-requ...@lists.freepascal.org wrote: In my program I need to use the OpenSSL unit from fpc (packages/openssl) AND I also need to use the lNET package. However my problem is that lNET also include a file named openssl.pas, although it seems to be never that the one included in packages it does not have the same methods included. So wheneven I include OpenSSL as a unit in my program it ALWAYS refer to the one in lNET, presumable because it is a package - how do I avoid this and instead use/refer to the fpc one? As Michael wrote it is not possible without unit renaming because there is no notion of package in compiler. The proper solution is to compile lNET package as a library (static library doesn't supported AFAIK but DLL is ok). Then write a small wrapper to import some types, classes, and functions and use DLL with shared memory. If you're required a really large interface of this package and then large wrapper to write, you should better decompose your application to compile some part as DLL with lNET package only. Thank you for your suggestion - but to be honest I think the easiest way for me is going to be: Use Lazarus to rename the OpenSSL unit from lnet, which hopefully renames all reference within the package itself. But where did you install lnet from in the first place? Just update to the latest version isn't that hard? I do not know which version you are using, but if it is a recent one, the rename of the openssl unit is the only change. ;) I've been using the one from here: http://svn.freepascal.org/svn/fpcprojects/lnet/tags/release_0_6_5 Btw: the openssl unit form lnet is exactly the same as the openssl unit in fpc. Maybe the trunk of lnet is updated, but otherwise there is actually a large difference in the two units. A whole lot of RSA/PEM and other certificate functions are not included in the lnet one. I made a quick diff of the two files (lnet vs. fpc opensl) and it is more than 100K bytes large... :) Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] OpenSSL
On 2015-11-17 18:25, Serguei TARASSOV wrote: On 17/11/2015 15:24, fpc-pascal-requ...@lists.freepascal.org wrote: Hi all. In my program I need to use the OpenSSL unit from fpc (packages/openssl) AND I also need to use the lNET package. However my problem is that lNET also include a file named openssl.pas, although it seems to be never that the one included in packages it does not have the same methods included. So wheneven I include OpenSSL as a unit in my program it ALWAYS refer to the one in lNET, presumable because it is a package - how do I avoid this and instead use/refer to the fpc one? Regards, -Torsten. As Michael wrote it is not possible without unit renaming because there is no notion of package in compiler. The proper solution is to compile lNET package as a library (static library doesn't supported AFAIK but DLL is ok). Then write a small wrapper to import some types, classes, and functions and use DLL with shared memory. If you're required a really large interface of this package and then large wrapper to write, you should better decompose your application to compile some part as DLL with lNET package only. Thank you for your suggestion - but to be honest I think the easiest way for me is going to be: Use Lazarus to rename the OpenSSL unit from lnet, which hopefully renames all reference within the package itself. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] OpenSSL
Hi all. In my program I need to use the OpenSSL unit from fpc (packages/openssl) AND I also need to use the lNET package. However my problem is that lNET also include a file named openssl.pas, although it seems to be never that the one included in packages it does not have the same methods included. So wheneven I include OpenSSL as a unit in my program it ALWAYS refer to the one in lNET, presumable because it is a package - how do I avoid this and instead use/refer to the fpc one? Regards, -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] IS operator and library created objects
On 2015-08-20 08:06, Sven Barth wrote: Am 20.08.2015 03:42 schrieb "Fabio Luis Girardi" mailto:fluisgira...@gmail.com>>: > Currently, I'm doing a small program that uses libraries, objects and the operator IS, that is know that this operator fails because of duplication of VMT. And /that/ is one of the reasons why dynamic packages were invented... > > Everyone know some alternative (or more elegant) method to test if a object created on a library is a class descendant without use object.ClassName? Or in case of use String to check the class name, how retrieve the class name of all descendant classes from a object? > Nope, there is no more elegant way. And you'll probably need to walk the class tree using ParentClass and retrieve each name. Note: an except-handler will suffer from the same problem if it needs to catch an exception that was raised from the library (or the other way round). You are going to a extreme fragile direction there. What about TObject.InheritsFrom(aclass : tclass) - Is that not the equivalent of the *IS* operator -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bootstrapping on Mac
On 2015-08-19 13:59, Jonas Maebe wrote: On 19/08/15 13:41, Torsten Bonde Christiansen wrote: I'm trying to build the compiler (svn checkout) from scratch using the bootstrapper binary "ppcuniversal" on a MAC running Mavericks (OS 10.9.x) The only supported/hassle-free way to bootstrap FPC (on any platform) is by starting from a complete installation of the latest FPC release (e.g. using the installer on our website). The bootstrap binaries are used by some package systems that build from source, but require detailed knowledge of the FPC build process to use and are completely unsupported. Ok, thanks - I had hoped for the simple sollution, but I will go with the full install. -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Bootstrapping on Mac
Hi List. I'm trying to build the compiler (svn checkout) from scratch using the bootstrapper binary "ppcuniversal" on a MAC running Mavericks (OS 10.9.x) I start the buildprocess with the following line: make all PP=~/Downloads/ppcuniversal CPU_TARGET=i386 OS_TARGET=darwin OPT="-gl -gw -godwarfsets -O-" (just for record, changing/removing the OPT does not help) The build process is fine until at some point where i get the following error: /Users/torsten/FreePascal/release_2_6_4/compiler/ppcross386 -Pi386 -Ur -Xs -O2 -n -S2h -Fu/Users/torsten/FreePascal/release_2_6_4/rtl/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/fcl-base/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/iconvenc/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/fcl-xml/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/fcl-passrc/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/fcl-process/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/chm/units/i386-darwin -Fu/Users/torsten/FreePascal/release_2_6_4/packages/univint/units/i386-darwin -FE. -FUunits/i386-darwin -gl -gw -godwarfsets -O- -di386 -dRELEASE fpclasschart.pp /Library/Developer/CommandLineTools/usr/bin/make -C fpcmkcfg all __missing_command_DATA2INC -b -s fppkg.cfg fppkg.inc fppkg make[3]: __missing_command_DATA2INC: No such file or directory make[3]: *** [fppkg.inc] Error 1 make[2]: *** [fpcmkcfg_all] Error 2 make[1]: *** [utils_all] Error 2 make: *** [build-stamp.i386-darwin] Error 2 I assume the problem here is that the program data2inc is missing, but I thought that it was built in the process and that the location was/is automatically passed during the build. The data2inc program IS available in the directory ./utils/ which can be seen here: torsten@torstens-mini:~/FreePascal/release_2_6_4$ find . -iname "data2inc*" ./utils/data2inc ./utils/data2inc.exm ./utils/data2inc.pp ./utils/units/i386-darwin/data2inc.o So am I doing something wrong when bootstrapping or is the somehow a bug related to the makefiles? kind regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] For .. in .. loops with sets and valued enums
Consider the following program: program Project1; type TMyEnum = ( a = 1, b = 3, c = 5 ); TMySet = set of TMyEnum; var Item: TMyEnum; begin for Item in TMySet do Writeln('Value = ', Integer(Item)); end. I would expect the output of the program to contain the values 1, 3 and 5 only. But the actual output is: Value = 1 Value = 2 Value = 3 Value = 4 Value = 5 Is this a bug or a know limitation of the "for ... In ... do" loop? I am using fpc 2.6.4 Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Internal error 200611031
Hi. I was playing around with class helpers in my code and suddenly ran into an internal error on compilation. I can try to make a sample project, but is this a known problem or did I stumple upon an unknown bug. I have tried googling the error, but nothing related shows up. My compiler is: Free Pascal Compiler version 2.6.4 Compiler Date : 2014/03/12 Compiler CPU Target: x86_64 Compiled with OPT="-gl -gw -godwarfsets -O-" regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Endian & Hex numbers
Hi list. Please forgive me if this is too dumb a question, but: When using a const written in hex, is the order significant? Ie. will eg. $1F01 result in the same value (7937) on both big-endian and little endian machines? Likewise, if I use an absolute reference to a variable is the endianness also significant? ex.: const A: SmallInt = $1F01; var B: array[0..1] of byte absolute A; Will B[0] be the same on both types of endian machines? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Common class type
Hi. Is there method in fpc to find the highest common class-type of two derived classes? Regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FieldAddress
On 2015-02-03 12:30, silvioprog wrote: On Tue, Feb 3, 2015 at 6:17 AM, Torsten Bonde Christiansen mailto:t...@epidata.info>> wrote: Hi, What does it take for a class to access a field using FieldAddress(...)? I have tried with both typeinfo on/off ({M+}), placing the field in private/protected/public/published sections but to no avail. My simple code is: TMyObject = class private FRef: TMyObject; procedure SetRef(AValue: TMyObject); public property Ref: TMyObject read FRef write SetRef; end; then i have tried to get the adress in two ways: AMyObject.FieldAddress('FRef'); //returns nil AMyObject.FieldAddress('Ref'); //also returns nil If i run my code through debugger, the VMT FieldTable is empty suggesting no information is created. This happens in all cases of typeinfo on/off and differenc sections... What can i do to make the fieldadress accessible? Regards, Torsten. This method return a field address, eg: {$M+} TMyObject = class(TObject) FRef: TMyObject; end; ... var VMyObject: TMyObject; VRef: Pointer; begin VMyObject := TMyObject.Create; VRef := VMyObject.FieldAddress('FRef'); If you whant to get a property, use the TypInfo.GetObjectProp function. So FieldAddress can only access published fields? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] FieldAddress
Hi, What does it take for a class to access a field using FieldAddress(...)? I have tried with both typeinfo on/off ({M+}), placing the field in private/protected/public/published sections but to no avail. My simple code is: TMyObject = class private FRef: TMyObject; procedure SetRef(AValue: TMyObject); public property Ref: TMyObject read FRef write SetRef; end; then i have tried to get the adress in two ways: AMyObject.FieldAddress('FRef'); //returns nil AMyObject.FieldAddress('Ref'); //also returns nil If i run my code through debugger, the VMT FieldTable is empty suggesting no information is created. This happens in all cases of typeinfo on/off and differenc sections... What can i do to make the fieldadress accessible? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] NTP
On 2015-01-29 16:08, Graeme Geldenhuys wrote: On 2015-01-29 08:10, Torsten Bonde Christiansen wrote: Does anyone have experience on how to get the current date/time of an NTP server? If you use the Indy components, they have an example included. Great - thanks. I will have a look tomorrow. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] NTP
Hi, Does anyone have experience on how to get the current date/time of an NTP server? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Optimization switches
Hi. By chance I was looking at help page for compiler switches regarding optimazations: http://www.freepascal.org/docs-html/prog/progsu58.html#x65-640001.2.58 And I wonder if the switches below "LEVEL3" (eg. REGVAR, UNCERTAIN, ...) must be explicit applied during a compile or if they are included in some of the levels? If they are indeed included when selecting a level, perhaps the manual should be updated such that it is clear which optimizations belongs to each level. Kind regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-24 10:57, Marco van de Voort wrote: In our previous episode, Torsten Bonde Christiansen said: Yes. A case where a check is missing doesn't automatically mean a feature has been implemented where that check is not needed. Overriding methods with declarations that don't match the original is a big thing. Crap... this means I have to redo some of my code. ;) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-24 10:38, Marco van de Voort wrote: In our previous episode, Torsten Bonde Christiansen said: Should I add this to the bugtracker? Yes. The code with Tfoo and TBar above also shouldn't not compile, at least not in Delphi mode. Should I report this as a bug where this construct is not allow at all (not just Delphi mode, bot all mode) or as a bug in regards to Delphi mode. Report it as a bug that it is not allowed at all in the current situation, with the added note that Delphi doesn't allow it either. Actually i would like to see this work, at least for objfpc, also with the construct where forward declared classes is possible. That's a separate language enhancement request, read http://www.freepascal.org/faq.var#extensionselect Since this is already possible in objfpc mode (at least partially) is it nessesary to mark it as a bug? I think of this as an undocumentet feature, which perhaps just needs testcases to ensure reliability. If you still consider it a bug I will spend some time trying to write a proposal as stated in the link you send previously. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-22 17:33, Marco van de Voort wrote: In our previous episode, Torsten Bonde Christiansen said: The problem seem to be that the a descendant enumerator class overriding a virtual method cannot return a class which i only forward declared. If the TFoo and TBar classes are moved above the TBarListEnumerator the code compiles without any problem. Should I add this to the bugtracker? Yes. The code with Tfoo and TBar above also shouldn't not compile, at least not in Delphi mode. Should I report this as a bug where this construct is not allow at all (not just Delphi mode, bot all mode) or as a bug in regards to Delphi mode. Actually i would like to see this work, at least for objfpc, also with the construct where forward declared classes is possible. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bug in enumerators 2.6.4
On 2014-03-22 22:34, hinsta...@yandex.ru wrote: What you do this for? Using override directive makes no sense in this case, so I suggest you just don't use it. If you don't use it, the descendant enumerator will still work like intended I Think override makes perfect sense in this case. I get to only implement the GetCurrent procedure once, the example is simplified but in my real-world application it does some additional structure checking, and in all derived classes i get to call the ancestor method but return an object of the type i need. If I could not override the code for GetCurrent the following forBar inBarList do Bar.Val2:=1; would not be able to know the Bar is a TBar, but would rather see Bar as a pointer (since in this case it inherits from TList). And all subsequent code would have to do some sort of typecasting. I hope that makes a little bit of sense... Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Bug in enumerators 2.6.4
Hi List. I think i have found a bug related to enumerators, overridden methods and forward declared classes. Please consider the code listed here: http://pastebin.com/8EkVDG5n The problem seem to be that the a descendant enumerator class overriding a virtual method cannot return a class which i only forward declared. If the TFoo and TBar classes are moved above the TBarListEnumerator the code compiles without any problem. Should I add this to the bugtracker? Regards Torsten Bonde Christiansen. ps. my compiler details: torsten@epidata:~$ ppcx64 -i Free Pascal Compiler version 2.6.4 Compiler Date : 2014/03/12 Compiler CPU Target: x86_64 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Bug in enumerators 2.6.4
Hi List. I think i have found a bug related to enumerators, overridden methods and forward declared classes. Please consider the code listed here: http://pastebin.com/8EkVDG5n The problem seem to be that the a descendant enumerator class overriding a virtual method cannot return a class which i only forward declared. If the TFoo and TBar classes are moved above the TBarListEnumerator the code compiles without any problem. Should I add this to the bugtracker? Regards Torsten Bonde Christiansen. ps. my compiler details: torsten@epidata:~$ ppcx64 -i Free Pascal Compiler version 2.6.4 Compiler Date : 2014/03/12 Compiler CPU Target: x86_64 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-30 14:33, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: Bug reported as: http://bugs.freepascal.org/view.php?id=25469 Including patch and program with test. Thank you, I will have a look ASAP. The test program compiles and runs fine without a patch applied. What am I supposed to see ? For me it still fails at parsing line no 31, however the problem is in PScanner.pp:1400. The Result (TToken) variable is not set at any point, hence with your compilation it may return a valid result, but mine fails. I believe my patch still applies, so please take a look the PScanner.pp code before ruling it out. Regards, Torsten Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-30 14:33, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: And if you provide fixes, make sure the testsuite still runs OK. I am not sure this case was tested at all - should i try implementing a new test or just advide what must be tested. I ask because i'm not at all familiar with the testing framework... :) I can't comment without knowing what it is, but if you provide a small test program that shows the bug, and that shows that the bug is fixed after your patch is applied, I'll integrate it with the unit tests. Bug reported as: http://bugs.freepascal.org/view.php?id=25469 Including patch and program with test. Thank you, I will have a look ASAP. The test program compiles and runs fine without a patch applied. What am I supposed to see ? It ought to fail at parsing line num 31 I will check again later tonight! -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-30 13:26, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-30 13:01, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing this release. If you want you can report what you have done here: http://wiki.freepascal.org/Testers_2.6.4 Hi Again. I have found some issues with PScanner in fcl-passrc. Should i report them to both the bugtracker, and the "Issues" page of 2.6.4 or just the bugtracker. You should always report bugs in the bugtracker. And if you provide fixes, make sure the testsuite still runs OK. I am not sure this case was tested at all - should i try implementing a new test or just advide what must be tested. I ask because i'm not at all familiar with the testing framework... :) I can't comment without knowing what it is, but if you provide a small test program that shows the bug, and that shows that the bug is fixed after your patch is applied, I'll integrate it with the unit tests. Bug reported as: http://bugs.freepascal.org/view.php?id=25469 Including patch and program with test. -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-30 13:01, Michael Van Canneyt wrote: On Mon, 30 Dec 2013, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing this release. If you want you can report what you have done here: http://wiki.freepascal.org/Testers_2.6.4 Hi Again. I have found some issues with PScanner in fcl-passrc. Should i report them to both the bugtracker, and the "Issues" page of 2.6.4 or just the bugtracker. You should always report bugs in the bugtracker. And if you provide fixes, make sure the testsuite still runs OK. I am not sure this case was tested at all - should i try implementing a new test or just advide what must be tested. I ask because i'm not at all familiar with the testing framework... :) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-30 12:54, Torsten Bonde Christiansen wrote: On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing this release. If you want you can report what you have done here: http://wiki.freepascal.org/Testers_2.6.4 Hi Again. I have found some issues with PScanner in fcl-passrc. Should i report them to both the bugtracker, and the "Issues" page of 2.6.4 or just the bugtracker. I will include fixes for the bugs as well and would really hope the are merged to the final 2.6.4. I forgot the mention, the bug is NOT fixed in trunk. -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-19 21:23, Marco van de Voort wrote: Hello We have placed the first release candidate of the Free Pascal Compiler version 2.6.4 on our ftp servers. You can help improve the upcoming 2.6.4 release by downloading and testing this release. If you want you can report what you have done here: http://wiki.freepascal.org/Testers_2.6.4 Hi Again. I have found some issues with PScanner in fcl-passrc. Should i report them to both the bugtracker, and the "Issues" page of 2.6.4 or just the bugtracker. I will include fixes for the bugs as well and would really hope the are merged to the final 2.6.4. Regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!
On 2013-12-19 21:23, Marco van de Voort wrote: Hello Changes that may break backwards compatibility are documented at: http://wiki.freepascal.org/User_Changes_2.6.4 This page does not yet exists? Is this correct? Regards, Torsten Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Android and cwstring
On 2013-08-01 21:58, Sven Barth wrote: On 01.08.2013 20:43, Torsten Bonde Christiansen wrote: On 2013-07-31 20:57, Sven Barth wrote: On 31.07.2013 20:55, Felipe Monteiro de Carvalho wrote: On Wed, Jul 31, 2013 at 8:51 PM, Sven Barth wrote: The cwstring of Android uses the ICU library libicuuc.so. Is this available in the NDK for one of the higher API levels? It is not in the list for API level 8. I don't know, I have merely quoted the commit message for when cwstring was changed from a stub to a more complete implementation for Android. If it is truly not available in lower API levels then I'd suggest to use fpwidestring anyway... hmmm i can't get fpwidestring to work, it seem that it is not compiled during a normal compiler build. The same goes for all of the collation units. Should i add and special defines to get them compiled or is it a bug in the makefile? How exactly did you compile? As described in the wiki with "make crossall OS_TARGET=android CPU_TARGET=arm ..." in the top level directory? In that case it should be compiled and a fpwidestring.ppu should be located in the $fpcsrc/rtl/units/arm-android directory. ̈́ I did that, but I also included a "crossinstall" which installed the units to somewhere else in my home dir. However now that i compare the $fpcsrc/rtl/units/arm-android with $install_dir/rtl/units/arm-android some of the files are missing - this includes the fpwidestring and collation files... strange? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Android and cwstring
On 2013-07-31 20:57, Sven Barth wrote: On 31.07.2013 20:55, Felipe Monteiro de Carvalho wrote: On Wed, Jul 31, 2013 at 8:51 PM, Sven Barth wrote: The cwstring of Android uses the ICU library libicuuc.so. Is this available in the NDK for one of the higher API levels? It is not in the list for API level 8. I don't know, I have merely quoted the commit message for when cwstring was changed from a stub to a more complete implementation for Android. If it is truly not available in lower API levels then I'd suggest to use fpwidestring anyway... hmmm i can't get fpwidestring to work, it seem that it is not compiled during a normal compiler build. The same goes for all of the collation units. Should i add and special defines to get them compiled or is it a bug in the makefile? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Android and cwstring
On 2013-07-31 20:57, Sven Barth wrote: On 31.07.2013 20:55, Felipe Monteiro de Carvalho wrote: On Wed, Jul 31, 2013 at 8:51 PM, Sven Barth wrote: The cwstring of Android uses the ICU library libicuuc.so. Is this available in the NDK for one of the higher API levels? It is not in the list for API level 8. I don't know, I have merely quoted the commit message for when cwstring was changed from a stub to a more complete implementation for Android. If it is truly not available in lower API levels then I'd suggest to use fpwidestring anyway... I did some research before i sent the mail and found the libucuuc.so using adb shell into an emulator. I will take a look at the fpwidestring and paswstring. Thanks for the help. REgards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Android and cwstring
Hi, I'm trying to create a library for use in an android application, but i'm having a hard time getting it to work correctly. More specifically i cannot get the library to use the "cwstring" unit. Below you see a working example of a library that works fine (the log entry is generated) when cwstring i commented out, but when included the android application just hangs on the message: 07-31 16:52:16.284: D/dalvikvm(338): Trying to load lib /data/data/dk.epidata.epidatatestproject/lib/libepitest.so 0x45f3e268 The error is most likely mine, my experience with android programming and libraries are limited, but I fail to see what I am doing wrong in this case. Just for record i use: torsten@Rainier:~$ ppcrossarm -i Free Pascal Compiler version 2.7.1 Compiler Date : 2013/07/25 Compiler CPU Target: arm Settings for android in .fpc.cfg: -CfVFPV3 #ifdef cpuarm -Xd -FD/home/torsten/AndroidDev/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin -Fl/home/torsten/AndroidDev/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib -XParm-linux-androideabi- #endif Regards, Torsten B. Christiansen. == library code == library project1; {$mode objfpc}{$H+} uses jni, // jni from packages/jni/src/jni.pas cmem, // includin cmem makes no difference cwstring // including cwstring make the library halt on load... :( ; const ANDROID_LOG_INFO=4; function LOGI(prio:longint;tag,text:pchar):longint; cdecl; varargs; external 'liblog.so' name '__android_log_print'; function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint; cdecl; begin result:=JNI_VERSION_1_6; end; exports JNI_OnLoad; begin LOGI(ANDROID_LOG_INFO, 'libepitest.so', 'Init Library'); end. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4
On 2013-05-22 13:50, m...@rpzdesign.com wrote: Are you saying that you are writing JNI routines in Pascal for android? If so, can you post some of the things like the pascal header files you use to allow for the creation of the .so files so that Java can call into pascal across the JNI interface. I have 2 projects that I need Pascal talking across the JNI interface. 1 for Mac OSX where I need pascal to call a JNI library and another Android where I need Java to call freepascal library (NDK) Thanks for any information you can share, +1 from me, I would like that too. Thanks, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC_JVM compilation fails on trunk
On 2013-04-26 22:53, Jonas Maebe wrote: On 26 Apr 2013, at 22:37, Torsten Bonde Christiansen wrote: I'm trying to follow this guide:http://wiki.freepascal.org/FPC_JVM/Building But when i reach the point where i do the actual compilation fail with the following output: torsten@epidata:~/FreePascal/fpc-trunk$ make all crossinstall CROSSOPT="-O2 -g" CPU_TARGET=jvm OS_TARGET=android INSTALL_PREFIX=~/fpc This command does not match what is written on the wiki page you refer to above. True, but i thought that the order of defines and make targets didn't matte? The only other part i left out was the FPCMAKE, but since the fpcmake i created i now located where the old one used to be I do not think that should matter either? make: -iVSPTPSOTO: Command not found This means that no fpc binary can be found in the path. This error is unrelated to building the JVM compiler specifically, it will happen regardless of what kind of compiler you try to build. Did you perform a standard installation of FPC 2.6.2 and is its installation directory in your path? I build fpc from scratch with my own settings, but all is installed into ~/fpc/... My path contains ~/fpc/bin in which i symlink to the different compilers and crosscompilers. Additionally, the merge of the 8086 branch broke several things in the compiler (but that's unrelated to the error you get above), so you may encounter other errors once you fix your configuration. For now, I would recommend sticking to r24323 of trunk (regardless of which platform you use). I "downgraded" to r24323, but still the same issue, even when reordering the defines and make targets. The actual error from make seem to be this though: make[3]: Entering directory `/home/torsten/FreePascal/fpc-trunk/compiler' make -C clean <=== "clean" is not a director, perhaps it is a target? make: Entering an unknown directory make: *** clean: No such file or directory. Stop. make: Leaving an unknown directory Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC_JVM compilation fails on trunk
Hi List. I'm trying to follow this guide: http://wiki.freepascal.org/FPC_JVM/Building But when i reach the point where i do the actual compilation fail with the following output: torsten@epidata:~/FreePascal/fpc-trunk$ make all crossinstall CROSSOPT="-O2 -g" CPU_TARGET=jvm OS_TARGET=android INSTALL_PREFIX=~/fpc make: -iVSPTPSOTO: Command not found make compiler_cycle RELEASE=1 make[1]: -iVSPTPSOTO: Command not found make[1]: Entering directory `/home/torsten/FreePascal/fpc-trunk' make -C compiler cycle make[2]: -iVSPTPSOTO: Command not found make[2]: Entering directory `/home/torsten/FreePascal/fpc-trunk/compiler' make OS_TARGET= CPU_TARGET= CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl CYCLELEVEL=1 make[3]: Entering directory `/home/torsten/FreePascal/fpc-trunk/compiler' make -C clean make: Entering an unknown directory make: *** clean: No such file or directory. Stop. make: Leaving an unknown directory make[3]: *** [rtlclean] Error 2 make[3]: Leaving directory `/home/torsten/FreePascal/fpc-trunk/compiler' make[2]: *** [cycle] Error 2 make[2]: Leaving directory `/home/torsten/FreePascal/fpc-trunk/compiler' make[1]: *** [compiler_cycle] Error 2 make[1]: Leaving directory `/home/torsten/FreePascal/fpc-trunk' make: *** [base.build-stamp.jvm-android] Error 2 torsten@epidata:~/FreePascal/fpc-trunk$ I'm using the 2.6.2 compiler and i have successfully compiled a new fpcmake, placed it such that I know it is first in the path, but still it fails. Any help is appriciated. Regards, Torsten B. Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Tree structure
On 2013-02-12 16:36, Michael Van Canneyt wrote: On Tue, 12 Feb 2013, Torsten Bonde Christiansen wrote: On 2013-02-12 16:13, Leonardo M. Ramé wrote: Hi, I would like to know if there's a standard tree structure where each node is a TObject. With "standard" I mean, in a standard package, like fcl-base. Leonardo M. Ramé http://leonardorame.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal FCL_base does have one: avl_tree Does not allow multiple children, only left/right, no ? Michael. True - but the original question gives no hint to whether this is desired or not... :) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Tree structure
On 2013-02-12 16:13, Leonardo M. Ramé wrote: Hi, I would like to know if there's a standard tree structure where each node is a TObject. With "standard" I mean, in a standard package, like fcl-base. Leonardo M. Ramé http://leonardorame.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal FCL_base does have one: avl_tree but so does LCL, which is named AvgLvlTree (found in LazUtils) I hope that helps... ;) Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] DOM and namespaces with prefix
On 2012-06-23 01:01, Daniel Gaspary wrote: On Tue, Jun 19, 2012 at 10:11 AM, Torsten Bonde Christiansen wrote: DDIInstance := XMLDoc.CreateElementNS('ddi:instance:3_0', 'DDIInstance'); DDIInstance.Prefix := 'ns1';// this gives me: which is great. // now I would like to expand with eg: xmlns:a="ddi:archive:3_0" Attr := XMLDoc.CreateAttributeNS('ddi:archive:3_0', 'huh'); Attr.Prefix := 'a'; DDIInstance.SetAttributeNode(Attr); // but this gives: How can i get the "xmlns:a="ddi:archive:3_0" without the additional attribute AND maintain the namespace + prefix in later elements? I believe that the solution(given by Sergei Gorelkin at [1]) is: DDIInstance.SetAttributeNS('ddi:archive:3_0','xmlns:a','ddi:archive:3_0'); [1] http://bugs.freepascal.org/view.php?id=22299#c60652 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal Great - thank you very much! -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] DOM and namespaces with prefix
Hi all. I am working on implementing a lite export routine from our program to the DDI XML format: http://www.ddialliance.org/Specification/DDI-Lifecycle/3.1/XMLSchema/ A convinient way of working with the DDI format is to prefix elements using common set of prefix'es, but having spent most of the day trying to I can only make it work with a single prefix. program project1; {$mode objfpc}{$H+} uses Classes, DOM, XMLWrite; var XMLDoc: TXMLDocument; DDIInstance: TDOMElement; Attr: TDOMAttr; begin XMLDoc := TXMLDocument.Create; DDIInstance := XMLDoc.CreateElementNS('ddi:instance:3_0', 'DDIInstance'); DDIInstance.Prefix := 'ns1';// this gives me: which is great. // now I would like to expand with eg: xmlns:a="ddi:archive:3_0" Attr := XMLDoc.CreateAttributeNS('ddi:archive:3_0', 'huh'); Attr.Prefix := 'a'; DDIInstance.SetAttributeNode(Attr); // but this gives: a:huh=""/> Xmldoc.AppendChild(DDIInstance); WriteXMLFile(XMLDOc, '/tmp/test.xml'); end. How can i get the "xmlns:a="ddi:archive:3_0" without the additional attribute AND maintain the namespace + prefix in later elements? Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] std::map equivalent?
On 2012-06-12 15:38, Xiangrong Fang wrote: Hi, Is there a std::map equivalent for free pascal? Thanks, Shannon If you wish to use generics you can try TFPGMap from the unit fgl. It does about the same. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] SIGFPE with SameValue()
On 2012-05-10 11:16, Jonas Maebe wrote: Torsten Bonde Christiansen wrote on Thu, 10 May 2012: On 2012-05-10 10:45, t.wieckow...@gmail.com wrote: it seams that MaxFloat get MaxDouble (FPC_HAS_TYPE_DOUBLE is defined) but SameValue uses as Single when overload. Works with SameValue(double(a),double(b),double(0)). How can that be, since I use Extended as type? http://bugs.freepascal.org/view.php?id=21199 Thanks. I can see that addid 0.0 to SameValue solves the problem. :) Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] SIGFPE with SameValue()
On 2012-05-10 10:45, t.wieckow...@gmail.com wrote: it seams that MaxFloat get MaxDouble (FPC_HAS_TYPE_DOUBLE is defined) but SameValue uses as Single when overload. Works with SameValue(double(a),double(b),double(0)). best regards Tomek ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal How can that be, since I use Extended as type? Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] SIGFPE with SameValue()
Hi List. I have discovered the following strange bug/problem. Please check out the following program and tell me which part is right and which is wrong, or perhaps what i'm doing wrong in this case. program project1; {$mode objfpc}{$H+} uses math; var a,b: extended; begin if SameValue(1, MaxFloat) then // This works? Writeln('Same') else WriteLn('Fail'); a := 1; b := MaxFloat; if SameValue(a,b) then // But this fails in SameValue with SIGFPE??? Writeln('Same') else WriteLn('Fail'); end. My setup : Free Pascal Compiler version 2.6.0 (from: http://svn.freepascal.org/svn/fpc/tags/release_2_6_0) Compiler Date : 2012/01/19 Compiler CPU Target: x86_64 FPC Compiled with extra options "-g -gl -godwarfsets", Kind regards, Torsten Bonde Christiansen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
Well maybe ExportAll compiler feature should be suggested? But please try this unit Unit1; {$mode objfpc}{$H+} interface procedure proc1; stdcall; procedure proc2; stdcall; implementation procedure proc1; stdcall; begin writeln('hello'); end; exports proc1; procedure proc2; stdcall; begin writeln('hello 2'); end; exports proc2; end. I tried and it didn't seem to work, however perhaps it could be related to that I'm trying to create a library for arm-linux on android. I've been following the guides from http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android which i know probably is trying to do something that's not possible. Anyway, thanks to both of you for the help so far. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 2011-12-12 20:04, Jonas Maebe wrote: On 12 Dec 2011, at 19:56, nore...@z505.com wrote: procedure proc1; stdcall; begin writeln('hello'); end; exports proc1; procedure proc2; stdcall; begin writeln('hello 2'); end; exports proc2; end. Notice how I put exports in several places... It works on win32.. It only partially works. Please see the bug report I mentioned earlier: http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=16070 Does this just mean I have to compile my library with -B every time? If that is the case, then I don't mind. I prefer to have a more manageable unit structure at the cost of an extra compiler option, than dealing with lots of includes or a very large exports section. Regards, Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 2011-12-12 00:48, nore...@z505.com wrote: Ok, thanks for clearifying that. I guess it's going to be a lot of include files instead... :) -Torsten. Why do you need include files in your case? You can put the units in the uses clause of your library. Because it is still going to give me a very long list of exports - considering I have approx. 200 methods to export. Instead I would do something like this: library something; {$DEFINE InterfaceSection} {$I unit1} [snip...] {$I unit20} {$UNDEFINE InterfaceSection} exports {$DEFINE ExportSection} {$I unit1}, [snip...] {$I unit20} {$UNDEFINE ExportSection} ; end. unit 1; {$IFDEF InterfaceSection} function Foo(a: integer): integer; begin result := a * a; end; {$ENDIF} {$IFDEF ExportSection} Foo name 'Bar' {$ENDIF} ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 2011-12-11 23:30, Jonas Maebe wrote: On 11 Dec 2011, at 23:18, Torsten Bonde Christiansen wrote: So in the following example "foo" would not be visible (neither as "foo" nor "bar") to other program (eg. a C-program) unless I added an *exports* section? Correct. See also http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=18552 Basically what i'm trying to do, is use a lot of units and I want avoid creating a HUGE *exports* section but rather name the methods in the units instead. That is not possible. Whether or not a routine is exported is a property of the library, not of the individual units that are used (directly or indirectly) by the library. Jonas___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal Ok, thanks for clearifying that. I guess it's going to be a lot of include files instead... :) -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared libries
On 2011-12-11 22:57, ik wrote: On Sun, Dec 11, 2011 at 23:35, Torsten Bonde Christiansen mailto:t...@epidata.dk>> wrote: Hi. I'm trying to create a shared library (under linux) and I not sure what the difference between the modifier *export* and the section *exports* is? Or perhaps when to use one and the other... export means that you can control the name of a symbol in how it will be in the elf file itself of the so. So you call your original procedure Foo, but you export it as 'baz', so using objdump in Linux, you'll find "baz" and not "Foo". Exports, is the way to tell the compiler what are the symbols you wish to make available for reuse in the so file itself, so I could bind to them. So in the following example "foo" would not be visible (neither as "foo" nor "bar") to other program (eg. a C-program) unless I added an *exports* section? library test; function foo(a: integer): integer; [export, alias: 'bar']; begin result := a * a; end; end. Basically what i'm trying to do, is use a lot of units and I want avoid creating a HUGE *exports* section but rather name the methods in the units instead. Regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Shared libries
Hi. I'm trying to create a shared library (under linux) and I not sure what the difference between the modifier *export* and the section *exports* is? Or perhaps when to use one and the other... I have read both the programmers guide (7.2) and reference guide (11.9.3) but this didn't really help me. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: RE : RE : [fpc-pascal] Working Free Pascal android JNI example
On 2011-11-25 13:38, Ludo Brands wrote: /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o: In function `_haltproc': androidprt0.as:(.text+0x0): multiple definition of `_haltproc' ./libandroidprt0.so:androidprt0.as:(.text+0x0): first defined here /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o: In function `_haltproc_eabi': A long time ago, august ;) , libandroidprt0 was a replacement for linux arm dllprt0.as that apparently was virtually empty. In the mean time dllprt0 contains all of libandroidprt0 + more. Hence the duplicate definitions. Just remove the -k"-landroidprt0". You won't miss anything. A lot has changed since august and I haven't followed the development closely. I think you better refer to the work Felipe is doing on android. http://wiki.lazarus.freepascal.org/Android_Interface Is it still a problem to use libraries under android? I believe I read somewhere that the env pointer is not set correctly. -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: RE : [fpc-pascal] Working Free Pascal android JNI example
Hi Ludo. I try to use you androidprt0.so but I keep getting the same error. I do not have much experience in the lower parts of how the linking/assembling is done, so I hope you can help me out here. I get the following error: $ ppcrossarm -b -B -XX -Xc -XD -Tlinux -darm -k"-landroidprt0" pascaljni.lpr Free Pascal Compiler version 2.4.4 [2011/11/18] for arm Copyright (c) 1993-2010 by Florian Klaempfl Target OS: Linux for ARMEL Compiling pascaljni.lpr Assembling pascaljni Linking libpascaljni.so /usr/local/bin/arm-linux-ld: warning: link.res contains output sections; did you forget -T? /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o: In function `_haltproc': androidprt0.as:(.text+0x0): multiple definition of `_haltproc' ./libandroidprt0.so:androidprt0.as:(.text+0x0): first defined here /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o: In function `_haltproc_eabi': androidprt0.as:(.text+0x8): multiple definition of `_haltproc_eabi' ./libandroidprt0.so:androidprt0.as:(.text+0x8): first defined here /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o:(.data+0x0): multiple definition of `operatingsystem_parameter_envp' ./libandroidprt0.so:(.data+0x0): first defined here /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o:(.data+0x4): multiple definition of `operatingsystem_parameter_argc' ./libandroidprt0.so:(.data+0x4): first defined here /usr/lib/fpc/2.4.4/units/arm-linux/rtl/dllprt0.o:(.data+0x8): multiple definition of `operatingsystem_parameter_argv' ./libandroidprt0.so:(.data+0x8): first defined here pascaljni.lpr(19) Error: Error while linking pascaljni.lpr(19) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted As you can se i'm using FPC 2.4.4 (releases2_4_4 of the subversion repository) and there is clearly a conflict between two competing unit. But how do I resolve this? Regards, Torsten Bonde Christiansen. On 2011-08-11 11:54, Ludo Brands wrote: My main doubt here is if androidprt0.as is really required, which would mean that I can only produce android libraries if I make changes to the compiler. In NativeTest\jni is a makeandroid.bat that assembles androidprt0 and calls ppcrossarm with -k"-landroidprt0". No need to change the compiler for that, unless there are conflicts with existing arm initialisation. Ludo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compilation error in crosscompiling lNet to arm-linux
On 2011-11-20 21:36, Jonas Maebe wrote: On 20 Nov 2011, at 21:30, Torsten Bonde Christiansen wrote: I get the following error when crosscompiling lNet to arm-linux. $ fpc -MObjFPC -Sgim -CX -O2 -Parm -gs -gl -vew -l -Fi../lib/sys -Fu../lib -Fu. -FUlib/arm-linux/ -dLNET_BASE -fPIC lnetbase.pas Free Pascal Compiler version 2.4.4 [2011/11/14] for arm Copyright (c) 1993-2010 by Florian Klaempfl Target OS: Linux for ARMEL Compiling lnetbase.pas Compiling /home/torsten/FreePascal/lnet/lib/lnet.pp Compiling /home/torsten/FreePascal/lnet/lib/levents.pp Compiling /home/torsten/FreePascal/lnet/lib/lcommon.pp *lcommon.pp(370,13) Fatal: Internal error 200502052* Fatal: Compilation aborted Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you did not specify a source file to be compiled) Is this a bug in the compiler? It's a missing feature. The problem is that you are trying to generate PIC ARM code, which is not yet implemented/supported. Is it going to be in 2.6. Perhaps in trunk? -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Compilation error in crosscompiling lNet to arm-linux
Hi List. I get the following error when crosscompiling lNet to arm-linux. $ fpc -MObjFPC -Sgim -CX -O2 -Parm -gs -gl -vew -l -Fi../lib/sys -Fu../lib -Fu. -FUlib/arm-linux/ -dLNET_BASE -fPIC lnetbase.pas Free Pascal Compiler version 2.4.4 [2011/11/14] for arm Copyright (c) 1993-2010 by Florian Klaempfl Target OS: Linux for ARMEL Compiling lnetbase.pas Compiling /home/torsten/FreePascal/lnet/lib/lnet.pp Compiling /home/torsten/FreePascal/lnet/lib/levents.pp Compiling /home/torsten/FreePascal/lnet/lib/lcommon.pp *lcommon.pp(370,13) Fatal: Internal error 200502052* Fatal: Compilation aborted Error: /usr/bin/ppcrossarm returned an error exitcode (normal if you did not specify a source file to be compiled) Is this a bug in the compiler? Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Location of fpvectorial
On 2011-11-10 09:14, Felipe Monteiro de Carvalho wrote: I moved fpvectorial out of fpc because I found it too slow/problematic for me to develop inside the FCL. it was bothersome to rebuild the FCL and reconfigure the environment noting that I develop across 5 different setups on a daily basis (Mac+2 virtual machines + dual boot on another computer). If I install an older compiler then my library is not available, users don't get fixes until a new release is done, etc. Not to mention that my renderer code requires TCanvas features which are not yet in TFPCustomCanvas and also that I'd like to use the powerful lazutils package. fpvectorial was never released in compiled form with any FPC release, so you will only have it installed from FPC if you are using an old fpc trunk snapshot or something like that. I've downloaded the releases_2_4_4 from the svn repository. The source code is included but you are right that it is not compiled. On Thu, Nov 10, 2011 at 9:04 AM, Torsten Bonde Christiansen wrote: The wiki page states to download from lazarus trunk, but the example files there do no use the lazarus package, but rather the one from fpc. Please file a bug report. Bug report filed: http://bugs.freepascal.org/view.php?id=20662 Is it best to use the lazarus/components version or the fpc version? Yes, lazarus/components The fpc version no longer exists. I noted that after I sent the mail. But thank you for the reply. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Location of fpvectorial
Hi List I'm rather confused about the location of fpvectorial, since I can find it in several places. I'm using fpc 2.4.4 and trunk of Lazarus, and fpvectorial exists both places but with different setups. The wiki page states to download from lazarus trunk, but the example files there do no use the lazarus package, but rather the one from fpc. Is it best to use the lazarus/components version or the fpc version? Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Cross Compiling from Linux to a Mac OS X 10.5 or 10.6 target. How? [SOLVED]
On 2011-08-09 12:59, Reinier Olislagers wrote: On 9-8-2011 12:21, Torsten Bonde Christiansen wrote: On 2011-08-09 10:46, Reinier Olislagers wrote: My pleasure - though I haven't finished yet& may run into things. It seems you're setting up a 32 bit environment. Both my Linux (Debian) and OSX machine are 64 bit - don't know if this will work. I've just tried to follow the guide, but seem to run into the same problem as many other apparently also do: At global scope: cc1plus: warning: unrecognized command line option "-Wno-long-doubl From what I can read on the web this is somehow related to 64-bit vs. 32-bit crosscompile, but I'm not sure how to solve it. The following resources are an interesting read, but didn't really seem to get me any further. http://code.google.com/p/iphone-dev/issues/detail?id=212#makechanges http://code.google.com/p/iphone-dev/issues/detail?id=14 Neither of the CFLAGS/LDFLAGS options helped me, perhaps someone have done this succesfully on a Ubuntu 10.04 x86_64 like my system. I've put this on the wiki, don't know if it helps On 64 bit Linux environments, fpc mailing list users have problems. Perhaps this [http://stackoverflow.com/questions/3024255/building-odcctools-in-a-64-bit-os StackOverflow question and answer] can help: in the configure step, you'd apparently need to set CC="gcc -m32" CXX="g++ -m32" ./configure blah blah blah ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal You may also put a note that there exists a launchpad ppa for ubuntu, then you don't need to compile the binutils yourself (which evidently can be a pain in the ...). https://launchpad.net/~flosoft/+archive/cross-apple <https://launchpad.net/%7Eflosoft/+archive/cross-apple> Btw. I got the compilation working on a Ubuntu 11.04 64-bit (within a VM), but since my main desktop still runs 10.04 I cannot use the ppa. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Cross Compiling from Linux to a Mac OS X 10.5 or 10.6 target. How? [SOLVED]
On 2011-08-09 10:46, Reinier Olislagers wrote: My pleasure - though I haven't finished yet& may run into things. It seems you're setting up a 32 bit environment. Both my Linux (Debian) and OSX machine are 64 bit - don't know if this will work. I've just tried to follow the guide, but seem to run into the same problem as many other apparently also do: At global scope: cc1plus: warning: unrecognized command line option "-Wno-long-doubl From what I can read on the web this is somehow related to 64-bit vs. 32-bit crosscompile, but I'm not sure how to solve it. The following resources are an interesting read, but didn't really seem to get me any further. http://code.google.com/p/iphone-dev/issues/detail?id=212#makechanges http://code.google.com/p/iphone-dev/issues/detail?id=14 Neither of the CFLAGS/LDFLAGS options helped me, perhaps someone have done this succesfully on a Ubuntu 10.04 x86_64 like my system. Kind regards, Torsten Bonde Christiansen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Skipping an the "inherited" of an ancestor
On 2011-01-14 23:05, Max Vlasov wrote: On Fri, Jan 14, 2011 at 10:38 PM, Torsten Bonde Christiansen mailto:t...@epidata.dk>> wrote: Hi List. Is it possible to jump a couple of levels in the inherited hierarchy when calling "inherited" on a method? Hmm, don't know whether you're the same person or not :), but I replied in a stackoverflow question the next day after it was asked (see here: http://stackoverflow.com/questions/4662744/delphi-how-to-call-inherited-inherited-ancestor/4670457#4670457 ) and it looked like the host didn't notice :). At least this variant seemed to work I'm sorry to say that it is not I who wrote on stackoverflow, but could as well have been. Anyways, your solution does not really solve the problem, since i will have to introduce a HackedParent class and that kinds of defeat the purpose. All I really want is to skip to a grandparent class using the normal "inherited" functionality. I have tried to look through the mailinglist archive, because I seem to remember someone else might have asked this question as well - but I haven't been able to find anything (yet). Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Skipping an the "inherited" of an ancestor
Hi List. Is it possible to jump a couple of levels in the inherited hierarchy when calling "inherited" on a method? A small example of what i'm trying to achieve below (and don't mind the incomplete TB class implementation). Kind regards, Torsten Bonde Christiansen. TA = class procedure DoSomething; virtual; end; TB = class(TA) procedure DoSomething; override; end; TC = class(TB) procedure DoSomething; override; end; . procedure TA.DoSomething; begin ... end; procedure TC.DoSomething; begin inherited TA.DoSomething; // This is not correct, but exemplifies what i'm trying to achieve. end; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] evaluation of set constant
On 2010-12-22 14:50, Jonas Maebe wrote: On 22 Dec 2010, at 14:15, Torsten Bonde Christiansen wrote: Is it possible to create a constant of a set that is based on an evaluation of other constants? (using fpc 2.4.2) A basic case could look like this: type TMyType = (a, b, c ,d); TMyTypes = set of TMyTypes; const SetX:TMyTypes = (a, b); SetY:TMyTypes = (c, d); These definitions should not compile, a set is defined as [a, b], not (a, b). Sorry - that was my bad, i just made a typo in the previous email. It's written with [] in my code. SetCombined: TMyTypes = SetX + SetY; // this gives me an "Error: Illegal expression" I have been reading throught the FPC docs, but it is unclear whether this is possible at all. The set operators allow this and according to FPC doc section on constants some expression evaluation is possible. So-called "typed constants" are actually initialised variables (for historical reasons). The compiler cannot evaluate expressions that involve variables (initialised or not). Change the constants into symbol constants if you want to use them in constant expressions: const SetX = [a, b]; SetY = [c, d]; SetCombined = SetX + SetY; Ahh... great. I never thought of the difference between typed constants and symbol constants. Now it works, Thank! Kind regards, Torsten Bonde Christiansen. EpiData Association. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] evaluation of set constant
Hi List. Is it possible to create a constant of a set that is based on an evaluation of other constants? (using fpc 2.4.2) A basic case could look like this: type TMyType = (a, b, c ,d); TMyTypes = set of TMyTypes; const SetX:TMyTypes = (a, b); SetY:TMyTypes = (c, d); SetCombined: TMyTypes = SetX + SetY; // this gives me an "Error: Illegal expression" I have been reading throught the FPC docs, but it is unclear whether this is possible at all. The set operators allow this and according to FPC doc section on constants some expression evaluation is possible. Kind regards, Torsten Bonde Christiansen. EpiData Association. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Detecting what is the linux distro
On 2010-10-11 13:33, ik wrote: Hello List, I'm looking for a proper way to detect the type of Linux distro. At first I thought about /etc/issue, but it seems that some are abusing this file. Many distro's uses /etc/__release, where is their name, but it's not a proper way either to detect, because not everyone uses it. Any additional ideas ? Most distros also include their name in the kernel, so using "uname -a" could also give a hint. But AFAIK there is no common place where all distros store the name. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Documentation differences...
On 2010-06-23 10:29, Graeme Geldenhuys wrote: Op 2010-06-23 10:15, Torsten Bonde Christiansen het geskryf: The official FPC documentation is: (http://www.freepascal.org/docs-html/rtl/) FPC does not show "skeleton" or partial documented units in it's documentation. It is all or nothing. (http://lazarus-ccr.sourceforge.net/docs/rtl/) As far as I know the following is true (please correct me if I am wrong). The Lazarus team thinks that "skeleton" (empty) or partial documentation is still handy, so they decided to build their own online documentation, but includes all units from RTL, FCL, LCL etc... This is what I heard years ago, but I don't know if this is still true. I'm also not sure what versions of FPC units does the Lazarus team use for there online docs (latest release version or Trunk) From what i can see Lazarus (trunk version) does by default open the Lazarus CCR version of the documentation file, this was my main reason for asking on the list since TComponent does not exists in the CCR version. Regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Documentation differences...
Hi List. I have been wondering for some time now what the difference is between the source documentation (online versions) on the pascal website (http://www.freepascal.org/docs-html/rtl/) and the one placed on the Lazarus CCR website (http://lazarus-ccr.sourceforge.net/docs/rtl/) - this goes not just for the RTL, but also FCL. Sometime i can find information regarding some classes in one but not the other, and at othertime it's the other way around. Perhaps I've overlook something, but I can't seem to find any logic in which is the most updated and why some things exist one place and not the other. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Is static strings prosible?
Hi list. Before I think about creating about report i better ask if it is possible to have static string in a class. The following construct fails using fpc 2.4.0 during the decrease of ansistring references. When cl.free is called, the call to CleanupInstance correctly identifies cl.c as a nil pointer, but something is wrong when it tries do dereference the reference pointer in fpc_ansistr_decr_ref. Should I report this is a bug or is static ansistrings not posible? Kind regards, Torsten Bonde Christiansen. { TBase } {$static on} TBase = class public a: string; static; public constructor Create; virtual; end; {$static off} { TInherited } TInherited = class(TBase) private c: string; public constructor Create; override; destructor Destroy; override; end; var cl: TInherited; begin cl := TInherited.Create; cl.a := 'asdf'; cl.Free; end; { TBase } constructor TBase.Create; begin end; { TInherited } constructor TInherited.Create; begin inherited Create; c := 'abc'; end; destructor TInherited.Destroy; begin c := ''; inherited Destroy; end; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPClassChart
Michael Van Canneyt wrote: On Thu, 22 Apr 2010, Torsten Bonde Christiansen wrote: I get a runtime A/V trying to create a class chart from one of my source files. Can you isolate the problem a bit more ? The best I can give is the output when it crashes. If you wish I can put the class it's trying to create the chart for on pastebin. This is the output i get when run: The error means there is an unsupported pascal construct in the file. But without the file, there is nothing more useful I can say. Michael. That's strange, because I have no problems compiling the file (and program) at all. The entire file can be found here: http://pastebin.org/167517 Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPClassChart
I get a runtime A/V trying to create a class chart from one of my source files. Can you isolate the problem a bit more ? The best I can give is the output when it crashes. If you wish I can put the class it's trying to create the chart for on pastebin. This is the output i get when run: $ fpclasschart --input="epicustombase.pas" --output=classchart.txt fpClassTree - Create class tree from pascal sources Version 2.4.0 [2010/03/24] (c) 2008 - Michael Van Canneyt, mich...@freepascal.org An unhandled exception occurred at $004843DF : EParserError : Expected "," or ":" at token ";" $004843DF line 207 of src/pparser.pp $004887EA line 1196 of src/pparser.pp $0048B433 line 2145 of src/pparser.pp $00487688 line 995 of src/pparser.pp $00486927 line 799 of src/pparser.pp $004864C6 line 713 of src/pparser.pp $0048BFD5 line 2301 of src/pparser.pp $004020AE line 569 of fpclasschart.pp $00403171 line 759 of fpclasschart.pp I hope it helps. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FPClassChart
Hi List, Is the fpclasschart program still maintained? I get a runtime A/V trying to create a class chart from one of my source files. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Accessing static field using properties.
Hi List After spending a good deal of time trying to figure out why my program crashed at runtime, I narrowed it down to accessing a static field in a class through a property. Although there were no compile time warning/error the program crashed the very instant i tried to access the static field through a property. There is no documentation stating that this is im-/possible, so I'm not sure whether this is a bug or just me writing horrible code... ;) Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Cross compiling: "from linux to Darwin or Mac OS X"
I do already own a legit Mac mini so I have not problem compiling my code for Mac OS X. But the mini is not my primary machine and is actually only meant for testing puposes, so I wanted to create a setup on my primary PC (64-bit linux) that, using a script, can compiles and cross compiles for all of our supported OS and CPU targets. Regards, Torsten Bonde Christiansen. Patrick Chevalley wrote: I try and give up. What I use now is a Mac virtual machine running on my Linux x64. It's too bad you have to turn to the dark side of the Internet for instruction on how to do that. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Cross compiling: "from linux to Darwin or Mac OS X"
Hi. After successfully having cross compiled from linux (64-bit) to Win32 and Win64 I wanted to see if i do the same for Mac OS X. But looking at the wiki page regarding cross compile (http://wiki.freepascal.org/Cross_compiling) it seem that this particular information is very old. Eg. the link to odcctools does not exist anymore, and searching the web for opendarwin/odcctools does not provide much help. So my question is if anyone have tried to do this recently and have a newbie guide on how to set this up. Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Subversion server making hickups...
Vincent Snijders wrote: The disks on svn2.freepascal.org was full, I removed some old files, can you retry? Great - working again! Thanks. -Torsten. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Subversion server making hickups...
Hi. For unknown reasons the svn2.freepascal.org subversion server seem to make hick-ups when I do an update. I get the error: svn: Can't find a temporary directory: Internal error This is only happening with the "svn2" server, not the regular svn.freepascal.org server?? Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Why can't 64bit FPC cross-compile 32bit
Graeme Geldenhuys wrote: Hi, What can the 32bit FPC compiler (currently I run under Linux) cross-compile to 32bit Windows or 64bit Linux. But the 64bit FPC (Linux) can only cross-compile to other 64bit platforms. Why not 32bit platforms too? It can, i've successfully managed to cross-compile to 32-bit linux and 32-bit windows on the same 64-bit linux machine. (that includes the FPC itself and Lazarus) There is a guide on the wiki here: http://wiki.freepascal.org/Cross_compiling Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] BNF grammar for fpc
The reason is probably more because Wirthian languages traditionally use recursive descent parsers. gcc as well for several years simply because a recursive descent parser is faster than one generated automatically from a BNF grammar. That is true, but the _expression_ power is not as good as a BNF grammar. There are some language constructs that is simply not posible with a LL(1) parser, when comparing to the LALR(1). I don't have the details with me right now, but have a decent book on compiler construction at home. Kind regards, - Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Is svn2.freepascal.org down?
I cant get in contact with the repository on svn2.freepascal.org (no ping reply either). Can someone give it a kick again... Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Variants and Extended
Ok, Thanks for the answer. -Torsten. It compiles, but it is only 64 bits, like a double. type extended = double; You can check this at compile time by doing {$IFDEF FPC_HAS_TYPE_EXTENDED} Vincent ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal