You are not logged in.
Pages: 1
I get a linker error when trying to build/compile this simple program
undefined reference to `.Lj14'
program test;
{$I mormot.defines.inc}
uses {$I mormot.uses.inc}
mormot.core.json;
var
P: Pointer;
FDictionary: TSynDictionary;
begin
P := FDictionary.Keys.ItemPtr(0);
end.
Builds OK if ItemPtr Index parameter is > 0.
---------------------------------------------
Debian buster
FPC 3.2.0-r45643
PUREMORMOT2
No optimizations
I also tried on FPC stable 3.2.2.
Offline
FPC bug for sure, I just wanted to know if anyone else can reproduce it or if it's just my system that is borked.
the main begin.end block isn't the culprit, this is just a MWE example, I did test it in a sub-procedure originally. I bet the bug has something to do with namespaces , the monolithic unit structure of mORMot 1 didn't trigger this bug on the same compiler version.
Last edited by pvn0 (2021-09-14 17:42:03)
Offline
Error: Compilation raised exception internally
Lazarus 2.0.10 + FPC 3.2.0 Win 32.
PUREMORMOT2
Offline
Initialization is not the problem, in my project I have everything set up correctly with constructor&destructor in a try..finally block and still produces this bug, I also tested it on this MWE example.
It's not that big of a deal tho because nobody should be calling ItemPtr function in production anyway since you can access the original Array directly, however it would be nice if TSynDictionary would have a public function that gives you a pointer to the start of the Keys & Values array respectively.
Offline
I've just compiled this example (and my project) successfully with FPC trunk 3.3.1-9066-gffc3e1780d [2021/09/14], so whatever bug seems to have been fixed somewhere after 3.2.2 stable.
FPC 3.2.0-r45643 is over a year old, when fpc team tags next stable release 3.3.x, consider testing mORMot 2 for that revision.
Another thing, since fpc source moved to gitlab, fpcupdeluxe wont accept the svn revision number r45643 because git hashes are now the "revision number", this makes documentation for installing on Linux obsolete.
Last edited by pvn0 (2021-09-15 08:42:00)
Offline
FPC trunk (main) on win32 : no problem.
Offline
Another thing, since fpc source moved to gitlab, fpcupdeluxe wont accept the svn revision number r45643 because git hashes are now the "revision number", this makes documentation for installing on Linux obsolete.
IMHO under Linux the easiest way is to install from packages. May be we shod use this in documentation :
Debian (tested on Ubuntu 20.04):
mkdir -p ~/dist
cd ~/dist
wget -O fpc-laz_3.2.0-1_amd64.deb https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.10/fpc-laz_3.2.0-1_amd64.deb/download
wget -O fpc-src_3.2.0-1_amd64.deb https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.10/fpc-src_3.2.0-1_amd64.deb/download
sudo apt install ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb -y
RPM (tested on OracleLinux8)
wget -O fpc-3.2.0-1.x86_64.rpm https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20x86_64%20RPM/Lazarus%202.0.10/fpc-3.2.0-1.x86_64.rpm/download
wget -O fpc-src-3.2.0-1.x86_64.rpm https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20x86_64%20RPM/Lazarus%202.0.10/fpc-src-3.2.0-1.x86_64.rpm/download
sudo dnf install ./fpc-3.2.0-1.x86_64.rpm ./fpc-src-3.2.0-1.x86_64.rpm -y
Offline
Offline
Currently, we use FPC 3.2.0 because 3.2.2 has troubles with variant late bindings, and trunk/3.3 is too much unstable.
No need to use a SVN revision in FpcUpDeluxe: just select FPC 3.2.0.
About TSynDictionary access to the keys and values, you can access directly the PPointer storage via Keys.Value and Values.Value.
Don't forget to Lock/UnLock the instance if you may such direct access.
And for a more modern access, consider using mormot.core.collections which can leverage TSynDictionary use via IKeyValue<> storage.
Online
thanks ab, I will stick to trunk for now and revert to 3.2.2 if necessary because I don't use variant late bindings.
btw, this forum desperately needs a thumbs up functionality for posts to reduce the amount of "thank you" replies
Offline
Pages: 1