[fpc-pascal] Shared library with resources which contain bitmaps on Linux
Hello FPC-Pascal users discussions! How can I build a shared library which contains many bitmaps loaded dynamically from the code using by: procedure TForm1.Button1Click(Sender: TObject); CONST MYRES_DLL='./libmyres.so'; begin FhMod := LoadLibrary (PCHAR (MYRES_DLL)); IF FhMod = 0 THEN begin ShowMessage ('Failed to load library ' + MYRES_DLL + '.'); end else begin ShowMessage ('Library ' + MYRES_DLL + ' is successfully loaded'); Image1.Picture.Bitmap.LoadFromResourceName (FhMod, 'pict'); end; IF FhMod <> 0 THEN begin FreeLibrary (FhMod); end; end; I have tried to do it in all ways I know, but loading the shared library was OK, but the LoadFromResourceName raises an exception "Resource XY not found". Thanks in advance. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Shared library with resources which contain bitmaps on Linux -- second try
Hello FPC-Pascal users discussions! How can I build a shared library which contains many bitmaps loaded dynamically from the code using by: procedure TForm1.Button1Click(Sender: TObject); CONST MYRES_DLL='./libmyres.so'; begin FhMod := LoadLibrary (PCHAR (MYRES_DLL)); IF FhMod = 0 THEN begin ShowMessage ('Failed to load library ' + MYRES_DLL + '.'); end else begin ShowMessage ('Library ' + MYRES_DLL + ' is successfully loaded'); Image1.Picture.Bitmap.LoadFromResourceName (FhMod, 'pict'); end; IF FhMod <> 0 THEN begin FreeLibrary (FhMod); end; end; I have tried to do it in all ways I know, but loading the shared library was OK, but the LoadFromResourceName raises an exception "Resource XY not found". Thanks in advance. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Error during building DEB package
Hello FPC-Pascal users discussions! [EMAIL PROTECTED]:/usr/lib/lazarus/fpcbuild$ sudo make deb NOGDB=1 [sudo] password for user: Debian version (2.2.2rc1) is not correct, expect 2.2.3 make: *** [debcheck] Error 1 What could it be a problem? Upgrade from 7.10 to 8.04 didn't solve this problem. Thanks in advance. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Error during creation of DEB package on Ubuntu
Hello FPC-Pascal, I have tried to build DEB package from latest snapshot and I've got this result: dh_gencontrol -i dh_md5sums -i dh_builddeb -i -- -Z bzip2 dpkg-deb: building package `fpc' in `../fpc_2.3.1-20080709_all.deb'. dpkg-deb: building package `fpc-source' in `../fpc-source_2.3.1-20080709_all.deb'. dpkg-deb: building package `fp-docs' in `../fp-docs_2.3.1-20080709_all.deb'. make[1]: Leaving directory `/usr/lib/lazarus/fpcbuild/build/fpc-2.3.1' dpkg-genchanges >../fpc_2.3.1-20080709_i386.changes dpkg-genchanges: including full source code in upload dpkg-buildpackage: full upload; Debian-native package (full source is included) mv -v -t . /usr/lib/lazarus/fpcbuild/build/fpc-2.3.1/../*.{deb,dsc,changes,tar.gz} mv: cannot stat `/usr/lib/lazarus/fpcbuild/build/fpc-2.3.1/../*.{deb,dsc,changes,tar.gz}': No such file or directory make: *** [debbuild] Error 1 -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello FPC-Pascal users discussions! Compilation shows me next ugly error messages during building lazarus with our components. How can I turn on move verbose outputs to see more about the problem. The strangest is, the same source code is buildable into Lazarus/Linux without any problem, but Linux runs on i386 and MacOS on PPC. I guess it is problem with compiler. ... Assembling resconf An unhandled exception occurred at $00148A30 : EAccessViolation : Access violation $00148A30 $001479D4 $0014C90C $0014B05C $001245C0 $0014FE78 $00150378 $0013321C $0012B980 $00109044 $0011D3C4 $0012AAEC $0012AE00 $0012BB88 $00Fatal: Compilation aborted 109044 $0011D3C4 $0012AAEC TExternalToolList.Run Exception: there was an error ERROR: tool reported error Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[2]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello all, Backtrace from lazbuild: An unhandled exception occurred at $00148A30 : Breakpoint 1, 0x00018090 in fpc_raiseexception () (gdb) bt #0 0x00018090 in fpc_raiseexception () #1 0x001106d4 in CHECKFORURGENTMESSAGES (P=1, parentfp=0xbfffe0c0) at outputfilter.pas:561 #2 0x0010e400 in TOUTPUTFILTER__READFPCOMPILERLINE (S=0x3129048, this=0x27002a0) #3 0x0010e0b8 in TOUTPUTFILTER__READLINE (S=0x3129048, DONTFILTERLINE=false, this=0x27002a0) at outputfilter.pas:418 #4 0x0010dbcc in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2700a20, ACALLER=0x25ded00, ATOOL=0x27c3ac0, this=0x27002a0) #5 0x003b7c1c in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x27c3ac0, MACROS=0x27aa200, THEOUTPUTFILTER=0x27002a0, COMPILEROPTIONS=0x27f4e90, this=0x25ded00) at exttooldialog.pas:370 #6 0x0017eb88 in TBUILDMANAGER__ONRUNCOMPILERWITHOPTIONS (EXTTOOL=0x27c3ac0, COMPOPTIONS=0x27f4e90, this=0x25cd860) at buildmanager.pas:1221 #7 0x0016e004 in TLAZPACKAGEGRAPH__COMPILEPACKAGE (APACKAGE=0x3148b80, FLAGS=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2935 #8 0x0016d600 in TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES (APACKAGE=0x0, FIRSTDEPENDENCY=0x3156f60, GLOBALS=0x31070e0, POLICIES=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2766 #9 0x3fac in TLAZBUILDAPPLICATION__COMPILEAUTOINSTALLPACKAGES (this=0x2730090) at lazbuild.lpr:502 #10 0x3c68 in TLAZBUILDAPPLICATION__BUILDLAZARUSIDE (this=0x2730090) at lazbuild.lpr:445 #11 0x67fc in TLAZBUILDAPPLICATION__RUN (this=0x2730090) at lazbuild.lpr:978 #12 0x7f48 in PASCALMAIN () at lazbuild.lpr:1167 #13 0x0002a980 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () #14 0x26fc in _start () #15 0x2400 in start () I wanted to make the backtrace from lazarus too, but when I run lazarus from terminal then terminal's menu is shown instead of lazarus' one. Thanks. TRoland; <<< 22.7.2008 11:28 - Mattias Gaertner "[EMAIL PROTECTED]" >>> MG> On Tue, 22 Jul 2008 11:02:40 +0200 MG> Roland Turcan <[EMAIL PROTECTED]> wrote: >> Hello FPC-Pascal users discussions! >> >> Compilation shows me next ugly error messages during building >> lazarus with our components. >> >> How can I turn on move verbose outputs to see more about the problem. >> >> The strangest is, the same source code is buildable into Lazarus/Linux >> without any problem, but Linux runs on i386 and MacOS on PPC. I guess >> it is problem with compiler. >> >> ... >> Assembling resconf >> An unhandled exception occurred at $00148A30 : >> EAccessViolation : Access violation >> $00148A30 >> $001479D4 >> $0014C90C >> $0014B05C >> $001245C0 >> $0014FE78 >> $00150378 >> $0013321C >> $0012B980 >> $00109044 >> $0011D3C4 >> $0012AAEC >> $0012AE00 >> $0012BB88 >> $00Fatal: Compilation aborted >> 109044 >> $0011D3C4 >> $0012AAEC >> >> TExternalToolList.Run Exception: there was an error >> ERROR: tool reported error MG> Start lazarus in gdb, reproduce the problem and create a backtrace. MG> http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB#Linux.2FBSD_Users.2FMacOSX MG> Mattias -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[4]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello Mattias, Next backtrace: Compiling ./unit/ResConf.pas Assembling resconf An unhandled exception occurred at $00148A20 : Breakpoint 1, 0x00018100 in fpc_raiseexception () (gdb) bt #0 0x00018100 in fpc_raiseexception () #1 0x0010dde4 in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2700a20, ACALLER=0x25ded00, ATOOL=0x27c3d90, this=0x27002a0) #2 0x003b7bac in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x27c3d90, MACROS=0x27aa800, THEOUTPUTFILTER=0x27002a0, COMPILEROPTIONS=0x27f4e90, this=0x25ded00) at exttooldialog.pas:370 #3 0x0017ebb8 in TBUILDMANAGER__ONRUNCOMPILERWITHOPTIONS (EXTTOOL=0x27c3d90, COMPOPTIONS=0x27f4e90, this=0x25cd860) at buildmanager.pas:1221 #4 0x0016e034 in TLAZPACKAGEGRAPH__COMPILEPACKAGE (APACKAGE=0x3148b80, FLAGS=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2935 #5 0x0016d630 in TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES (APACKAGE=0x0, FIRSTDEPENDENCY=0x3156f60, GLOBALS=0x3107130, POLICIES=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2766 #6 0x401c in TLAZBUILDAPPLICATION__COMPILEAUTOINSTALLPACKAGES (this=0x2730090) at lazbuild.lpr:502 #7 0x3cd8 in TLAZBUILDAPPLICATION__BUILDLAZARUSIDE (this=0x2730090) at lazbuild.lpr:445 #8 0x686c in TLAZBUILDAPPLICATION__RUN (this=0x2730090) at lazbuild.lpr:978 #9 0x7fb8 in PASCALMAIN () at lazbuild.lpr:1167 #10 0x0002a9f0 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () #11 0x276c in _start () #12 0x2470 in start () (gdb) c Continuing. EAccessViolation : Access violation $00148A20 $001479C4 $0014C8FC $0014B04C $001245B0 $0014FE68 $00150368 $0013320C $0012B970 $00109034 $0011D3B4 $0012AADC $0012ADF0 $0012BB78 $00Fatal: Compilation aborted 109034 $0011D3B4 $0012AADC TExternalToolList.Run Exception: there was an error ERROR: tool reported error Program exited with code 02. (gdb) But I don't see any debug information from freepascal's executable. This is really strange, because our package is compilable alone without problem. TRoland; <<< 22.7.2008 15:27 - Mattias Gärtner "[EMAIL PROTECTED]" >>> MG> Zitat von Roland Turcan <[EMAIL PROTECTED]>: >> Hello all, >> >> Backtrace from lazbuild: >> >> An unhandled exception occurred at $00148A30 : >> >> Breakpoint 1, 0x00018090 in fpc_raiseexception () >> (gdb) bt >> #0 0x00018090 in fpc_raiseexception () >> #1 0x001106d4 in CHECKFORURGENTMESSAGES (P=1, parentfp=0xbfffe0c0) at >> outputfilter.pas:561 >> #2 0x0010e400 in TOUTPUTFILTER__READFPCOMPILERLINE (S=0x3129048, >> this=0x27002a0) >> #3 0x0010e0b8 in TOUTPUTFILTER__READLINE (S=0x3129048, DONTFILTERLINE=false, >> this=0x27002a0) at outputfilter.pas:418 >> #4 0x0010dbcc in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2700a20, >> ACALLER=0x25ded00, ATOOL=0x27c3ac0, this=0x27002a0) >> #5 0x003b7c1c in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x27c3ac0, >> MACROS=0x27aa200, THEOUTPUTFILTER=0x27002a0, COMPILEROPTIONS=0x27f4e90, >> this=0x25ded00) at exttooldialog.pas:370 >>[...] MG> This exception is normal and caught in ide/exttooldialog.pas 387. MG> Please continue and see what comes next: MG> gdb ./lazarus.app/Contents/MacOS/lazarus MG> break FPC_RAISEEXCEPTION MG> r MG> bt MG> c MG> bt MG> c MG> bt MG> Mattias MG> ___ MG> fpc-pascal maillist - fpc-pascal@lists.freepascal.org MG> http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[6]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello Mattias, MG> I think the AV happens somewhere in the finally part of ide/outputfilter.pas MG> 375. MG> I added some verbosity in rev 15849. MG> Please update lazarus svn and compile IDE and lazbuild clean with MG> -dVerboseOFExecute. MG> Then try again. I have tried this: (gdb) run Starting program: /usr/local/share/lazarus/lazbuild --build-ide=-dVerboseOFExecute and also this (gdb) run Starting program: /usr/local/share/lazarus/lazbuild --build-ide=-va-dVerboseOFExecute but the result doesn't have more information: Compiling ./unit/ResConf.pas Assembling resconf An unhandled exception occurred at $00148A20 : Breakpoint 1, 0x000174c0 in fpc_raiseexception () (gdb) bt #0 0x000174c0 in fpc_raiseexception () #1 0x0010d1e4 in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2700a20, ACALLER=0x25e0d20, ATOOL=0x3113230, this=0x27002a0) #2 0x003b736c in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x3113230, MACROS=0x27aaae0, THEOUTPUTFILTER=0x27002a0, COMPILEROPTIONS=0x27f4e90, this=0x25e0d20) at exttooldialog.pas:370 #3 0x0017dfd8 in TBUILDMANAGER__ONRUNCOMPILERWITHOPTIONS (EXTTOOL=0x3113230, COMPOPTIONS=0x27f4e90, this=0x25cf890) at buildmanager.pas:1221 #4 0x0016d454 in TLAZPACKAGEGRAPH__COMPILEPACKAGE (APACKAGE=0x3148b80, FLAGS=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2935 #5 0x0016ca50 in TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES (APACKAGE=0x0, FIRSTDEPENDENCY=0x31570f0, GLOBALS=0x310f150, POLICIES=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2766 #6 0x33dc in TLAZBUILDAPPLICATION__COMPILEAUTOINSTALLPACKAGES (this=0x2730090) at lazbuild.lpr:502 #7 0x3098 in TLAZBUILDAPPLICATION__BUILDLAZARUSIDE (this=0x2730090) at lazbuild.lpr:445 #8 0x5c2c in TLAZBUILDAPPLICATION__RUN (this=0x2730090) at lazbuild.lpr:978 #9 0x7378 in PASCALMAIN () at lazbuild.lpr:1167 #10 0x00029db0 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () #11 0x1b2c in _start () #12 0x1830 in start () What did I wrong? MG> Can you reproduce the bug in a smaller package and send me the example? Actually the package contains over 500 units, but when I/we find the reason then I will make some. PS: I am going to holiday and I will not reply to any email (no computer, no Internet) until 4.8. Thanks for everything you did for me. TRoland; <<< 23.7.2008 17:02 - Mattias Gärtner "[EMAIL PROTECTED]" >>> MG> Zitat von Roland Turcan <[EMAIL PROTECTED]>: >> Hello Mattias, >> >> Next backtrace: >> >> Compiling ./unit/ResConf.pas >> Assembling resconf >> An unhandled exception occurred at $00148A20 : >> >> Breakpoint 1, 0x00018100 in fpc_raiseexception () >> (gdb) bt >> #0 0x00018100 in fpc_raiseexception () >> #1 0x0010dde4 in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2700a20, >> ACALLER=0x25ded00, ATOOL=0x27c3d90, this=0x27002a0) >> #2 0x003b7bac in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x27c3d90, >> MACROS=0x27aa800, THEOUTPUTFILTER=0x27002a0, COMPILEROPTIONS=0x27f4e90, >> this=0x25ded00) at exttooldialog.pas:370 MG> I think the AV happens somewhere in the finally part of ide/outputfilter.pas MG> 375. MG> I added some verbosity in rev 15849. MG> Please update lazarus svn and compile IDE and lazbuild clean with MG> -dVerboseOFExecute. MG> Then try again. MG> Can you reproduce the bug in a smaller package and send me the example? MG> Mattias MG> ___ MG> fpc-pascal maillist - fpc-pascal@lists.freepascal.org MG> http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[2]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello Mattias, MG> /usr/local/share/lazarus/lazbuild --build-ide="-va -dVerboseOFExecute" I have done all things you wrote me, but the result of compilation didn't write any line written by WriteLn inside of IFDEFs. Maybe there could be a bug during parsing of -d parameter and IFDEF sections were not compiled into the code. Therefore I have commented IFDEFs out to get them into lazbuild and the result is the following: Compiling ./unit/ResConf.pas Assembling resconf An unhandled exception occurred at $00148A20 : TOutputFilter.Execute W1 TOutputFilter.Execute W2 EAccessViolation : Access violation $00148A20 $001479C4 $0014C8FC $0014B04C $001245B0 $0014FE68 $00150368 $0013320C $0012B970 $00109034 $0011D3B4 $0012AADC $0012ADF0 $0012BB78 $00Fatal: Compilation aborted 109034 $0011D3B4 $0012AADC TOutputFilter.Execute W3 TOutputFilter.Execute W4 TOutputFilter.Execute W5 TOutputFilter.Execute W6 TOutputFilter.Execute W7 TExternalToolList.Run Exception: there was an error ERROR: tool reported error TRoland; <<< 25.7.2008 0:45 - Mattias Gaertner "[EMAIL PROTECTED]" >>> MG> On Thu, 24 Jul 2008 23:58:45 +0200 MG> Roland Turcan <[EMAIL PROTECTED]> wrote: >> Hello Mattias, >> >> MG> I think the AV happens somewhere in the finally part of >> MG> ide/outputfilter.pas 375. >> MG> I added some verbosity in rev 15849. >> MG> Please update lazarus svn and compile IDE and lazbuild clean with >> MG> -dVerboseOFExecute. >> MG> Then try again. >> >> I have tried this: >> >> (gdb) run >> Starting program: /usr/local/share/lazarus/lazbuild >> --build-ide=-dVerboseOFExecute MG> Sorry. A misunderstanding. MG> You need to update lazarus svn and rebuild lazbuild itself, before MG> trying to use lazbuild to build your package. Which means: MG> cd /usr/local/share/lazarus MG> svn up MG> make clean all lazbuilder MG> ./lazbuild --build-ide=-va > all_output.txt MG> >> and also this >> >> (gdb) run >> Starting program: /usr/local/share/lazarus/lazbuild >> --build-ide=-va-dVerboseOFExecute MG> Note: Multiple parameters must be separated by space: MG> /usr/local/share/lazarus/lazbuild --build-ide="-va -dVerboseOFExecute" MG> >>[...] MG> Mattias -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[3]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello Mattias, I have forgotten to send also result of building under gdb. Here is: Compiling ./unit/ResConf.pas Assembling resconf An unhandled exception occurred at $00148A20 : Breakpoint 1, 0x00017500 in fpc_raiseexception () (gdb) bt #0 0x00017500 in fpc_raiseexception () #1 0x0010d334 in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2788a20, ACALLER=0x25e9d40, ATOOL=0x2997200, this=0x27882a0) #2 0x003b7bbc in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x2997200, MACROS=0x29780c0, THEOUTPUTFILTER=0x27882a0, COMPILEROPTIONS=0x297ce90, this=0x25e9d40) at exttooldialog.pas:370 #3 0x0017e458 in TBUILDMANAGER__ONRUNCOMPILERWITHOPTIONS (EXTTOOL=0x2997200, COMPOPTIONS=0x297ce90, this=0x25d8860) at buildmanager.pas:1222 #4 0x0016d804 in TLAZPACKAGEGRAPH__COMPILEPACKAGE (APACKAGE=0x29ccb80, FLAGS=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2947 #5 0x0016ce00 in TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES (APACKAGE=0x0, FIRSTDEPENDENCY=0x29db0a0, GLOBALS=0x25e66d0, POLICIES=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2778 #6 0x341c in TLAZBUILDAPPLICATION__COMPILEAUTOINSTALLPACKAGES (this=0x27b8090) at lazbuild.lpr:502 #7 0x30d8 in TLAZBUILDAPPLICATION__BUILDLAZARUSIDE (this=0x27b8090) at lazbuild.lpr:445 #8 0x5c6c in TLAZBUILDAPPLICATION__RUN (this=0x27b8090) at lazbuild.lpr:978 #9 0x73b8 in PASCALMAIN () at lazbuild.lpr:1167 #10 0x00029df0 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () #11 0x1b6c in _start () #12 0x1870 in start () (gdb) c Continuing. TOutputFilter.Execute W1 TOutputFilter.Execute W2 EAccessViolation : Access violation $00148A20 $001479C4 $0014C8FC $0014B04C $001245B0 $0014FE68 $00150368 $0013320C $0012B970 $00109034 $0011D3B4 $0012AADC $0012ADF0 $0012BB78 TOutputFilter.Execute W3 TOutputFilter.Execute W4 TOutputFilter.Execute W5 TOutputFilter.Execute W6 TOutputFilter.Execute W7 TExternalToolList.Run Exception: there was an error ERROR: tool reported error TRoland; <<< 4.8.2008 11:56 - Roland Turcan "[EMAIL PROTECTED]" >>> RT> Hello Mattias, MG>> /usr/local/share/lazarus/lazbuild --build-ide="-va -dVerboseOFExecute" RT> I have done all things you wrote me, but the result of compilation RT> didn't write any line written by WriteLn inside of IFDEFs. Maybe there RT> could be a bug during parsing of -d parameter and IFDEF sections were RT> not compiled into the code. Therefore I have commented IFDEFs out to RT> get them into lazbuild and the result is the following: RT> Compiling ./unit/ResConf.pas RT> Assembling resconf RT> An unhandled exception occurred at $00148A20 : RT> TOutputFilter.Execute W1 RT> TOutputFilter.Execute W2 RT> EAccessViolation : Access violation RT> $00148A20 RT> $001479C4 RT> $0014C8FC RT> $0014B04C RT> $001245B0 RT> $0014FE68 RT> $00150368 RT> $0013320C RT> $0012B970 RT> $00109034 RT> $0011D3B4 RT> $0012AADC RT> $0012ADF0 RT> $0012BB78 RT> $00Fatal: Compilation aborted RT> 109034 RT> $0011D3B4 RT> $0012AADC RT> TOutputFilter.Execute W3 RT> TOutputFilter.Execute W4 RT> TOutputFilter.Execute W5 RT> TOutputFilter.Execute W6 RT> TOutputFilter.Execute W7 RT> TExternalToolList.Run Exception: there was an error RT> ERROR: tool reported error RT> TRoland; RT> <<< 25.7.2008 0:45 - Mattias Gaertner "[EMAIL PROTECTED]" >>> MG>> On Thu, 24 Jul 2008 23:58:45 +0200 MG>> Roland Turcan <[EMAIL PROTECTED]> wrote: >>> Hello Mattias, >>> >>> MG> I think the AV happens somewhere in the finally part of >>> MG> ide/outputfilter.pas 375. >>> MG> I added some verbosity in rev 15849. >>> MG> Please update lazarus svn and compile IDE and lazbuild clean with >>> MG> -dVerboseOFExecute. >>> MG> Then try again. >>> >>> I have tried this: >>> >>> (gdb) run >>> Starting program: /usr/local/share/lazarus/lazbuild >>> --build-ide=-dVerboseOFExecute MG>> Sorry. A misunderstanding. MG>> You need to update lazarus svn and rebuild lazbuild itself, before MG>> trying to use lazbuild to build your package. Which means: MG>> cd /usr/local/share/lazarus MG>> svn up MG>> make clean all lazbuilder MG>> ./lazbuild --build-ide=-va > all_output.txt MG>> >>> and also this >>> >>> (gdb) run >>> Starting program: /usr/local/share/lazarus/lazbuild >>> --build-ide=-va-dVerboseOFExecute MG>> Note: Multiple parameters must be separated by space: MG>> /usr/local/share/lazarus/lazbuild --build-ide="-va -dVerboseOFExecute" MG>> >>>[...] MG>> Mattias -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[4]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello Mattias, I have also uncommented some DebugLns which are inside of code: Compiling ./unit/ResConf.pas Assembling resconf An unhandled exception occurred at $00148A20 : TOutputFilter.Execute After Loop TOutputFilter.Execute fProcess.ExitStatus=217 Breakpoint 1, 0x000173e0 in fpc_raiseexception () (gdb) bt #0 0x000173e0 in fpc_raiseexception () #1 0x0010d33c in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2788a20, ACALLER=0x25e9d40, ATOOL=0x2c35340, this=0x27882a0) #2 0x003b7bbc in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x2c35340, MACROS=0x29780c0, THEOUTPUTFILTER=0x27882a0, COMPILEROPTIONS=0x297ce90, this=0x25e9d40) at exttooldialog.pas:370 #3 0x0017e458 in TBUILDMANAGER__ONRUNCOMPILERWITHOPTIONS (EXTTOOL=0x2c35340, COMPOPTIONS=0x297ce90, this=0x25d8860) at buildmanager.pas:1222 #4 0x0016d804 in TLAZPACKAGEGRAPH__COMPILEPACKAGE (APACKAGE=0x29ccb80, FLAGS=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2947 #5 0x0016ce00 in TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES (APACKAGE=0x0, FIRSTDEPENDENCY=0x29db0a0, GLOBALS=0x25e66d0, POLICIES=Invalid C/C++ type code 10 in symbol table. ) at packagesystem.pas:2778 #6 0x32fc in TLAZBUILDAPPLICATION__COMPILEAUTOINSTALLPACKAGES (this=0x27b8090) at lazbuild.lpr:502 #7 0x2fb8 in TLAZBUILDAPPLICATION__BUILDLAZARUSIDE (this=0x27b8090) at lazbuild.lpr:445 #8 0x5b4c in TLAZBUILDAPPLICATION__RUN (this=0x27b8090) at lazbuild.lpr:978 #9 0x7298 in PASCALMAIN () at lazbuild.lpr:1167 #10 0x00029cd0 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () #11 0x1a4c in _start () #12 0x1750 in start () (gdb) c Continuing. TOutputFilter.Execute W1 TOutputFilter.Execute W2 EAccessViolation : Access violation $00148A20 $001479C4 $0014C8FC $0014B04C $001245B0 $0014FE68 $00150368 $0013320C $0012B970 $00109034 $0011D3B4 $0012AADC $0012ADF0 $0012BB78 TOutputFilter.Execute W3 TOutputFilter.Execute W4 TOutputFilter.Execute W5 TOutputFilter.Execute W6 TOutputFilter.Execute W7 TExternalToolList.Run Exception: there was an error ERROR: tool reported error Program exited with code 02. <<< 4.8.2008 12:03 - Roland Turcan "[EMAIL PROTECTED]" >>> RT> Hello Mattias, RT> I have forgotten to send also result of building under gdb. Here is: RT> Compiling ./unit/ResConf.pas RT> Assembling resconf RT> An unhandled exception occurred at $00148A20 : RT> Breakpoint 1, 0x00017500 in fpc_raiseexception () RT> (gdb) bt RT> #0 0x00017500 in fpc_raiseexception () RT> #1 0x0010d334 in TOUTPUTFILTER__EXECUTE (THEPROCESS=0x2788a20, RT> ACALLER=0x25e9d40, ATOOL=0x2997200, this=0x27882a0) RT> #2 0x003b7bbc in TEXTERNALTOOLLIST__RUN (EXTTOOL=0x2997200, RT> MACROS=0x29780c0, THEOUTPUTFILTER=0x27882a0, RT> COMPILEROPTIONS=0x297ce90, this=0x25e9d40) at exttooldialog.pas:370 RT> #3 0x0017e458 in TBUILDMANAGER__ONRUNCOMPILERWITHOPTIONS RT> (EXTTOOL=0x2997200, COMPOPTIONS=0x297ce90, this=0x25d8860) at buildmanager.pas:1222 RT> #4 0x0016d804 in TLAZPACKAGEGRAPH__COMPILEPACKAGE RT> (APACKAGE=0x29ccb80, FLAGS=Invalid C/C++ type code 10 in symbol table. RT> ) at packagesystem.pas:2947 RT> #5 0x0016ce00 in TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES RT> (APACKAGE=0x0, FIRSTDEPENDENCY=0x29db0a0, GLOBALS=0x25e66d0, RT> POLICIES=Invalid C/C++ type code 10 in symbol table. RT> ) at packagesystem.pas:2778 RT> #6 0x341c in RT> TLAZBUILDAPPLICATION__COMPILEAUTOINSTALLPACKAGES (this=0x27b8090) at lazbuild.lpr:502 RT> #7 0x30d8 in TLAZBUILDAPPLICATION__BUILDLAZARUSIDE RT> (this=0x27b8090) at lazbuild.lpr:445 RT> #8 0x5c6c in TLAZBUILDAPPLICATION__RUN (this=0x27b8090) at lazbuild.lpr:978 RT> #9 0x73b8 in PASCALMAIN () at lazbuild.lpr:1167 RT> #10 0x00029df0 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR () RT> #11 0x1b6c in _start () RT> #12 0x1870 in start () RT> (gdb) c RT> Continuing. RT> TOutputFilter.Execute W1 RT> TOutputFilter.Execute W2 RT> EAccessViolation : Access violation RT> $00148A20 RT> $001479C4 RT> $0014C8FC RT> $0014B04C RT> $001245B0 RT> $0014FE68 RT> $00150368 RT> $0013320C RT> $0012B970 RT> $00109034 RT> $0011D3B4 RT> $0012AADC RT> $0012ADF0 RT> $0012BB78 RT> TOutputFilter.Execute W3 RT> TOutputFilter.Execute W4 RT> TOutputFilter.Execute W5 RT> TOutputFilter.Execute W6 RT> TOutputFilter.Execute W7 RT> TExternalToolList.Run Exception: there was an error RT> ERROR: tool reported error RT> TRoland; RT> <<< 4.8.2008 11:56 - Roland Turcan "[EMAIL PROTECTED]" >>> RT>> Hello Mattias, MG>>> /usr/local/share/lazarus/lazbuild --build-ide="-va -dVerboseOFExecute" RT>> I have done all things you wrote me, but the result of compilation RT>> didn't write any line written by WriteLn inside of IFDEFs. Maybe there R
Re[2]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello All, Does anybody have any idea, what I can do with this problem? Thanks. TRoland; <<< 4.8.2008 14:08 - "Vinzent Höfler" "[EMAIL PROTECTED]" >>> VH> Original-Nachricht >> Zitat von Roland Turcan <[EMAIL PROTECTED]>: >> >> > Hello Mattias, >> > >> > I have also uncommented some DebugLns which are inside of code: >> > >> > Compiling ./unit/ResConf.pas >> > Assembling resconf >> > An unhandled exception occurred at $00148A20 : >> > TOutputFilter.Execute After Loop >> > TOutputFilter.Execute fProcess.ExitStatus=217 >> >> Hmm. Maybe this means the compiler got an runtime error 217. I wonder what >> this means. VH> That it stopped due to an unhandled exception (that is what RTE217 means). VH> Vinzent. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[4]: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC
Hello Mattias, I have got some new facts about my problem. When I tried to execute lazbuild with ./lazbuild -B --build-ide="-va -dVerboseOFExecute" I've got the executable. When I try to start it, then nothing is shown. When I try it over gdb then it writes that MG> macg4:lazarus test$ gdb lazarus.app/ MG> GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct 2 04:11:19 UTC 2007) MG> Copyright 2004 Free Software Foundation, Inc. MG> GDB is free software, covered by the GNU General Public License, and you are MG> welcome to change it and/or distribute copies of it under certain conditions. MG> Type "show copying" to see the conditions. MG> There is absolutely no warranty for GDB. Type "show warranty" for details. MG> This GDB was configured as "powerpc-apple-darwin"...Reading MG> symbols for shared libraries .. done MG> MG> (gdb) r MG> Starting program: MG> /usr/local/share/lazarus/lazarus.app/Contents/MacOS/lazarus MG> Reading symbols for shared libraries + done MG> Reading symbols for shared libraries . done in this point starts "Never ending story" and nothing is shown. Then I press Ctrl-C MG> ^C MG> Program received signal SIGINT, Interrupt. MG> 0x917803a8 in poll$UNIX2003 () MG> (gdb) PS: msgview.lrs and msgview.lfm are from SVN 15417. TRoland; <<< 4.8.2008 18:08 - Mattias Gärtner "[EMAIL PROTECTED]" >>> MG> Zitat von Roland Turcan <[EMAIL PROTECTED]>: >> Hello All, >> >> Does anybody have any idea, what I can do with this problem? >>[...] MG> I never saw this problem. >> >> > Compiling ./unit/ResConf.pas >> >> > Assembling resconf >> >> > An unhandled exception occurred at $00148A20 : >> >> > TOutputFilter.Execute After Loop >> >> > TOutputFilter.Execute fProcess.ExitStatus=217 >> >> >> >> Hmm. Maybe this means the compiler got an runtime error 217. I wonder what >> >> this means. >> >> VH> That it stopped due to an unhandled exception (that is what RTE217 >> means). MG> Normally a process stopping with runtime error 217 gives: MG> TCompiler.WriteError Internal compiler error! (217) MG> Internal compiler error! (217) MG> But Roland does not get this error message and the gdb backtraces do not help MG> much. And for some reasons both lazarus and fpc have trouble. FPC gives 217 and MG> TProcess can not handle it. So it is no normal 217. MG> Mattias MG> ___ MG> fpc-pascal maillist - fpc-pascal@lists.freepascal.org MG> http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Binary compatibility between Intel CPU and PowerPC CPU
Hello FPC-Pascal users discussions! What is the best way to keep the binary compatibility among different CPU architectures. I need to make our own database engine compatible and other binary files, that user still can use our data from i386 or PowerPC computer. I really don't like the idea to change the order of all numeric variables on PowerPC, because it costs time of CPU. There must be easier way how to keep the compatibility. Could you give me some hints for better solution. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[2]: [fpc-pascal] Binary compatibility between Intel CPU and PowerPC CPU
Hello all, Thanks for all responses and I've got the answer I thought I get, but I don't like it. :-| Never mind. I cannot make any change on the data structure which is on the market about 10 years, but at least I have one advantage. The software was developed and is still used on i386 platform which means, that the endian conversion is needed only for PowerPC computers which are anyway old fashioned and they will vanish soon, because Apple prefers i386 instead. The question still is, how big effort is for PowerPC to make endian convertion. TRoland; <<< 16.9.2008 19:26 - Jeff Wormsley "[EMAIL PROTECTED]" >>> JW> Well, the (inefficient / multiplatform - choose one) way is to not store JW> data as binary, instead using something like XML. Probably not an JW> option, but there will be a tradeoff and a penalty no matter what. One JW> way would be store the data in the endianness of the consistently slower JW> platform (so as not to further slow down a system that is already JW> slow). Another would be to pick the endianness of the most popular JW> platform for your product so that it performs as well as possible where JW> the most users are. Its a decision you'll have to make on your own, though. JW> Jeff. JW> Roland Turcan wrote: >> Hello FPC-Pascal users discussions! >> >> What is the best way to keep the binary compatibility among different >> CPU architectures. >> >> I need to make our own database engine compatible and other binary >> files, that user still can use our data from i386 or PowerPC computer. >> >> I really don't like the idea to change the order of all numeric >> variables on PowerPC, because it costs time of CPU. >> >> There must be easier way how to keep the compatibility. >> >> Could you give me some hints for better solution. >> >> JW> -- JW> I haven't smoked for 2 years, 4 weeks and 2 days, saving $3,427.14 and JW> not smoking 22,847.63 cigarettes. JW> ___ JW> fpc-pascal maillist - fpc-pascal@lists.freepascal.org JW> http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Building latest SVN
Hello FPC-Pascal users discussions! It stops with message: > systemh.inc(84,2) Error: User defined: Building trunk is only > supported when using the latest release as a starting compiler. but it is uncomfortable to rollback to latest release to build up latest SVN. There must be "nicer" way, but how. PS: What is the reason to show this error? -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Access violation during compilation and linking
Hello all, It often happens to me, that during compilation FPC raises an exception and often is enough just to clean up directories where are *.o and *.ppu located. Sometimes it depends also on a problem in my code, but it is very difficult to distinguish where the problem is. Can I build FPC with debug information to get more details where the exception occured and not to get only addresses from stack, but nothing more. Thanks. PS: My question is related to compiler on Mac OS X 10.5 -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[2]: [fpc-pascal] Access violation during compilation and linking
Hello Jonas, At first, thank you for your reply. <<< 12.3.2009 10:09 - Jonas Maebe "jonas.ma...@elis.ugent.be" >>> JM> Roland Turcan wrote on do, 12 mrt 2009: >> It often happens to me, that during compilation FPC raises an >> exception and often is enough just to clean up directories where are >> *.o and *.ppu located. Sometimes it depends also on a problem in my >> code, but it is very difficult to distinguish where the problem is. JM> Please submit bug reports (with a sample program that reproduces the JM> problem) when it is due to a problem in your code. The compiler should JM> never crash in that case, and such bugs are usually fairly easy to fix. It is really not easy, because my project I am just fighting with has about two thousands units/forms. JM> It obviously should not crash in other situations either, but it's JM> known that a complete rewrite of the unit handling system is required JM> to fix all crashes related to the presence of old .o/.ppu files. >> Can I build FPC with debug information to get more details where the >> exception occured and not to get only addresses from stack, but >> nothing more. JM> You can build it with JM>make OPT='-O- -gl" JM> to include debug information and the lineinfo. This will symbolise the JM> stack trace when it crashes (or if that does not work, you can then JM> run it in gdb and use the "bt" command to show a stack trace when it JM> crashes). I have longer time a difficulty to solve this message when I try to build fpc with "sudo make clean all": Makefile:2279: *** No libgdb.a found, supply NOGDB=1 to disable debugger support. of course, then I use "sudo make clean all NOGDB=1" and it builds fine, but without debugger support I need. I am a newbie to MacOSX 10.5 and therefore I would like to ask how to install libgdb.a library which is requested. Thanks for any reply in advance. JM> Jonas JM> JM> This message was sent using IMP, the Internet Messaging Program. JM> ___ JM> fpc-pascal maillist - fpc-pascal@lists.freepascal.org JM> http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] RECORD alignment issue on Mac OS X intel based
Hello FPC-Pascal users discussions! I am posting the same request to this mailing list and I posted into lazarus. Thanks for any answer in advance. TRoland; > Hello Dmitry, > > Thanks for your reply, but I think, that you haven't understood me > what I am trying to explain. > > I have binary contents which are copied from memory using by an > application which is written in Delphi. I am porting an application to > MacOS X 10.5, but I need to use the same structures as I have in > Delphi and Kylix where "NOT PACKED" records are aligned. > > The fact is, that FPC compiler on intel based Mac OS X builds up > application which contains records "packed" by 4 bytes by default. > > I need to get the same behavior in intel based mac os x as I have in > other platforms. > > What should I do to build FPC compiler which will behave the same on > all platforms. > > TRoland; > > <<< 27.4.2009 17:04 - dmitry boyarintsev "skalogryz.li...@gmail.com" >>> db>> use: db>> TYPE TMyOne = packed record db>> First:integer; db>> Second:extended; db>> END; db>> to be sure about 20 bytes boundary. > db>> thanks, db>> dmitry > > db>> Hello All, db>> db>> I have found some new information about this problem: db>> db>> 1. db>> db>> TYPE TMyOne =record db>>First:integer; db>>Second:integer; db>> end; db>> db>> ... then the size of this object is 2*4 bytes. db>> db>> 2. db>> db>> TYPE TMyOne =record db>>First:integer; db>>Second:double; db>> END; db>> db>> ... where I would expect 4 + 8 bytes = 12 bytes db>> ... but the size of this object is 16! db>> db>> db>> 3. db>> db>> TYPE TMyOne =record db>>First:integer; db>>Second:extended; db>> END; db>> db>> ... where I would expect 4 + 16 bytes = 20 bytes db>> ... but the size of this object is 32! db>> db>> db>> So this proves me, that compiler tries to align the data structure to db>> multiplied size of biggest element to which fit all elements. db>> db>> I have understood this behavior, but this happens me in these cases: db>> db>> 1. Delphi 7 db>> 2. Kylix 3 db>> 3. Lazarus on Ubuntu db>> 4. Lazarus on PowerPC Mac OS X 10.5 db>> db>> but on Intel Based Mac OS X 10.5 Mini with Intel Duo 2 Core it db>> DOESN'T. Therefore I have problems with parsing of binaries back to db>> memory. db>> db>> I don't expect CPU specific problem, otherwise it would not work db>> active projects, therefore I think it must be compiler specific db>> problem. db>> db>> Do you have any idea? db>> db>> Thanks in advance. db>> db>> Greetings, TRoland; db>> db>> db>> <<< 25.4.2009 9:43 - Roland Turcan "k...@rotursoft.sk" >>> RT>>> Hello Diettrich, db>> RT>>> To tell the truth this code and style I got from previous developer RT>>> and I really don't know why he decided to get the size of header from RT>>> the binary instead of getting its size. The fact is, that this RT>>> "optimistic variant" of coding is on many places. :-| db>> RT>>> TRoland; db>> RT>>> <<< 24.4.2009 19:56 - Hans-Peter Diettrich "drdiettri...@aol.com" >>> HPD>>>> Roland Turcan schrieb: db>> >>>>> BB> How is HeaderLen declared ? >>>>> >>>>> Stream.Read (HeaderLen, SIZEOF (HeaderLen)); >>>>> >>>>> where information header's length is stored into binary. db>> HPD>>>> The you should verify that HeaderLen <= SizeOf(FHeader), before HPD>>>>Stream.Read (FHeader, HeaderLen); db>> HPD>>>> Otherwise this statement will overwrite the following FItem data, with HPD>>>> the fatal consequences you already experienced. db>> HPD>>>> When a header will ever change in size (or structure), it's wise to HPD>>>> store a version number in the data files. Then you can read the stored HPD>>>> header data into the exactly applicable header type (record), and HPD>>>> convert that record into the current THeader definition, field by field. db>> HPD>>>> DoDi -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] ASM code conversion from Delphi
Hello all, How can I write as ASM this assignment which is valid code for Delphi: mov DWord ptr TCPUIDData (edi).r_eax,eax where TCPUIDData is declared as: TYPE TCPUIDData =PACKED RECORD r_eax :CARDINAL; r_ebx :CARDINAL; r_edx :CARDINAL; r_ecx :CARDINAL; END; Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FlushBuffers of FileStream
Hello FPC-Pascal users discussions! I have used this Delphi/Kylix3 this code for flushing of buffers in my own stream descendant {$IFDEF WIN32} FlushFileBuffers (Handle); {$ELSE} fdatasync (Handle); {$ENDIF} I have found in linux.pp calling of fdatesync, but ... How to flush buffers in Mac OS X? Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Calling DO_SYSCALL on Mac OS X
Hello FPC-Pascal users discussions! I need to flush buffers from TFileStream which I should use function "fpfsync (Handle)", but as far as I found, there is no implementation of DO_SYSCALL for mac. DO_SYSCALL is implemented only for BSD. When my application crashes all files modified over TFileStream are broken. How to force flushing file stream? Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re[2]: [fpc-pascal] Calling DO_SYSCALL on Mac OS X
<<< 20.5.2009 15:54 - Jonas Maebe "jonas.ma...@elis.ugent.be" >>> JM> On 20 May 2009, at 15:40, Roland Turcan wrote: >> I need to flush buffers from TFileStream which I should use function >> "fpfsync (Handle)", but as far as I found, there is no implementation >> of DO_SYSCALL for mac. DO_SYSCALL is implemented only for BSD. JM> Why do you think that you need DO_SYSCALL? I just didn't find relation of fpfsync function to mac os x implementation. >> When my application crashes all files modified over TFileStream are >> broken. >> >> How to force flushing file stream? JM> uses JM>unix; JM> ... JM>fpfsync(handle). I have the same actually, but it doesn't work as I expect. When I write into FileStream any data I call FlushBuffer function which contains fpfsync(handle), but because if still buggy version of ported application I have some expections which crashes application and then nearly all changed files are broken. Are you sure, that fpfsync works fine on Mac OS? JM> Jonas -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] How to add new function related to MAC OS X
Hello fpc-pas...@lists.freepascal.org! 1. I want to add new function for Mac OS X which calls FCNTL with F_FULLSYNC to the existing source tree, but I am really confused from the files to be changed/added. I see that there are many include files which declare functions for Mac OS X, but they come from *BSD directories. I know, that it is because of compatibility with *BSD, but the interface comes from BSD dir and implementation from FreeBSD dir. How is it with directory tree among plaftforms? 2. I want to use SysCall unit which is located in /rtl/unix, but it cannot find it. When I use Unix unit I have not problem. But they are in the same directory?! Thanks in advance for any reply. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Building SVN on Mac OS X 10.5.8 intel
Hello FPC-Pascal users discussions! I am not able to build SVN 14295. /Users/test/lazarus/fpcsrc/compiler/ppc386 -XX -CX -Ur -Xs -O2 -n -Fu/Users/test/lazarus/fpcsrc/rtl/units/i386-darwin -Fu/Users/test/lazarus/fpcsrc/packages/univint/units/i386-darwin -FE. -FUunits/i386-darwin -di386 -dRELEASE src/CocoaAll.pas Foundation.inc(7,2) Fatal: Can't open include file "NSAffineTransform.inc" Fatal: Compilation aborted make[4]: *** [CocoaAll.ppu] Error 1 make[3]: *** [fpc_smart] Error 2 make[2]: *** [cocoaint_smart] Error 2 make[1]: *** [packages_smart] Error 2 make: *** [build-stamp.i386-darwin] Error 2 What could be wrong? Thanks in advance. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Building SVN on Mac OS X 10.5.8 intel
<<< 03.12.2009 15:24 - Jonas Maebe "jonas.ma...@elis.ugent.be" >>> JM> On 03 Dec 2009, at 14:45, Roland Turcan wrote: >> I am not able to build SVN 14295. >> >> /Users/test/lazarus/fpcsrc/compiler/ppc386 -XX -CX -Ur -Xs -O2 -n - >> Fu/Users/test/lazarus/fpcsrc/rtl/units/i386-darwin -Fu/Users/test/ >> lazarus/fpcsrc/packages/univint/units/i386-darwin -FE. -FUunits/i386- >> darwin -di386 -dRELEASE src/CocoaAll.pas >> Foundation.inc(7,2) Fatal: Can't open include file >> "NSAffineTransform.inc" >> Fatal: Compilation aborted >> make[4]: *** [CocoaAll.ppu] Error 1 >> make[3]: *** [fpc_smart] Error 2 >> make[2]: *** [cocoaint_smart] Error 2 >> make[1]: *** [packages_smart] Error 2 >> make: *** [build-stamp.i386-darwin] Error 2 >> >> What could be wrong? JM> I have no idea. I cannot reproduce this problem. Does the file /Users/ JM> test/lazarus/fpcsrc/packages/cocoaint/src/foundation/ JM> NSAffineTransform.inc exist? Yes, that file existed, but I have solved this by checking out of new SVN. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] GetProcAddress
Hello friends, I have written a very simple library which contains only two exports. It is intended to be a bridge between an old application and clipboard on linux to exchange data. --- library clipbrdgtk; {$MODE Delphi} uses Classes, Interfaces, Clipbrd; function clipboard_getastext:PChar; cdecl; export; begin result := PChar (Clipboard.AsText); end; PROCEDURE clipboard_setastext (iStr:PChar); cdecl; export; begin Clipboard.AsText := String (iStr); end; exports clipboard_getastext, clipboard_setastext; begin // end. - when I later try to load it for testing in Lazarus test application I cannot find the exports: - TYPE TClipboard_GetAsText = FUNCTION:PChar; CDECL; TYPE TClipboard_SetAsText = PROCEDURE (iStr:PChar); CDECL; TYPE TClipbrd =CLASS PRIVATE FHandle:HMODULE; FGetAsText:TClipboard_GetAsText; FSetAsText:TClipboard_SetAsText; FUNCTION GetAsText: STRING; PROCEDURE SetAsText(CONST Value: STRING); PUBLIC CONSTRUCTOR Create; DESTRUCTOR Destroy; OVERRIDE; PROPERTY AsText:STRING READ GetAsText WRITE SetAsText; END; IMPLEMENTATION USES Classes, SysUtils, Forms, dynlibs; { TClipbrd } CONSTRUCTOR TClipbrd.Create; var s :string; BEGIN FHandle := 0; s := ExtractFilePath (Application.ExeName) + 'clipbrdgtk.so'; IF FileExists (s) then begin FHandle := LoadLibrary (PChar (s)); END; FGetAsText := NIL; FSetAsText := NIL; IF FHandle <> 0 THEN begin FGetAsText := GetProcAddress (FHandle, PChar ('clipboard_getastext')); FSetAsText := GetProcAddress (FHandle, PChar ('clipboard_setastext')); END; END; DESTRUCTOR TClipbrd.Destroy; BEGIN IF FHandle <> 0 THEN begin FreeLibrary (FHandle); END; INHERITED; END; FUNCTION TClipbrd.GetAsText: STRING; BEGIN IF Assigned (FGetAsText) THEN begin RESULT := FGetAsText; END; END; PROCEDURE TClipbrd.SetAsText(const Value: STRING); BEGIN IF Assigned (FSetAsText) THEN begin FSetAsText (PChar (Value)); END; END; --- What could be wrong, that it doesn't find the exports and FGetAsText and FSetAsText stay NIL; Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Delphi mode syntax error
Hello all, I use Delphi style of programing in Lazarus to keep a compatibility with Kylix and therefore I want to get this code which is valid of Freepascal's ObjectPascal, but in {$MODE Delphi} it doesn't accept calling of "MyItems[index]" and writes "Array type required". How to adapt this code to be valid for Delphi mode. TYPE PtrUInt = DWord; TMyObj = PtrUInt; PMyObj = ^TMyObj; TArr= ARRAY OF TMyObj; procedure TForm1.FormCreate(Sender: TObject); VAR MyItems :PMyObj; Arr :TArr; begin SetLength (Arr, 5); Arr[0] := 1; Arr[1] := 2; Arr[2] := 3; Arr[3] := 4; Arr[4] := 5; MyItems := Pointer (Arr); ShowMessage (IntToStr (MyItems[0])); end; Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Delphi mode syntax error
<<< 19.01.2010 11:39 - Jonas Maebe "jonas.ma...@elis.ugent.be" >>> JM> On 19 Jan 2010, at 11:27, Jonas Maebe wrote: >> On 19 Jan 2010, at 11:14, Roland Turcan wrote: >> >>> ShowMessage (IntToStr (MyItems[0])); >> >> I think this should work: >> ShowMessage (IntToStr (MyItems[0]())); >> >> Please also file a bug report with a compilable example (which does >> not depend on Lazarus) that demonstrates the problem JM> Well, at least if the original code compiles with Delphi/Kylix. Thank Jonas for you reply, but FreePascal and Kylix as well reports the same error. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Delphi mode syntax error
<<< 19.01.2010 13:10 - Jonas Maebe "jonas.ma...@elis.ugent.be" >>> JM> On 19 Jan 2010, at 12:57, Michael Van Canneyt wrote: >> It should not compile in Delphi mode. >> Array syntax is not supported by Delphi. JM> Oops, only now I see he was trying to index a pointer like an array. JM> And even in FPC I would very strongly recommend against typecasting a JM> dynamic array to a pointer and then performing operations using this JM> pointer. Dynamic arrays are opaque structures and trying to directly JM> access the underlying data should never be done. Hello Jonas, But this ways is already used in LCL/FPC source as well. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Fatal: Internal Error 20051152
Hello friends, It started to show this %subject% since I added some code into {$IF MyBoolCondition} example: {$MODE Delphi} Unit MyUnit; interface Uses MyConditions; {$IF MyCond} //some declaration implementation // some code {$ELSE} //some declaration implementation // some code {$IFEND} end. What could be a reason and how to avoid it? Thanks in advance. -- Mac OS X 10.5.8 Intel Lazarus SVN r23561 FreePascal r14805 -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Erorr: Illegal type conversion: "Set Of ShortInt" to "LongInt"
Hello FPC-Pascal users discussions! I have this conversion: type TWordSet = set of 0..15; PWordSet = ^TWordSet; var btn: TMsgDlgButtons; begin ... Integer(PWordSet(@btn)^) := Params[0]; // Params is Variant ... end; With FPC 2.4 it is OK, but up-to-date FPC SVN reports error in subject. Is it a bug or it needs different conversion. How can I fix it? Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Erorr: Illegal type conversion: "Set Of ShortInt" to "LongInt"
Thanks for fast and helpful answer. It works fine. TRoland; <<< 08.10.2010 10:41 - Jonas Maebe "jonas.ma...@elis.ugent.be" >>> JM> On 08 Oct 2010, at 10:33, Roland Turcan wrote: >> I have this conversion: >> >> type TWordSet = set of 0..15; >> PWordSet = ^TWordSet; >> >> var btn: TMsgDlgButtons; >> >> begin >> ... >> Integer(PWordSet(@btn)^) := Params[0]; // Params is Variant >> ... >> end; >> >> >> With FPC 2.4 it is OK, but up-to-date FPC SVN reports error in >> subject. >> >> Is it a bug or it needs different conversion. JM> http://wiki.freepascal.org/User_Changes_Trunk#Sizes_of_sets_in_TP.2FDelphi_mode JM> Jonas -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Error: Can't take the address of constant expressions
Hello all, I have this code: type TMyObj = class private MyPWord:PWord; ... end; procedure TMyObj.Some; begin ... Inc (Cardinal (MyPWord), 2); ... end; and compiler says %subj% This code works fine on 32bit compiler, but what should I change to get this running on 64bit and get the code still compatible with 32bit compiler as well. Thanks. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Assembling (pipe) /Users/{standard input}:2540:suffix or operands invalid for `cmovns'
Hello all, I was trying to compile my project with FPC rev16967 on Mac OS X 10.5. CONST NoChartData='No data for chart.'; ... TextRect (R, x, y, NoChartData, TR); ... Compiling ./comp/rtschart.pas 100 144.684/149.856 Kb Used 200 144.801/150.112 Kb Used 300 144.859/150.112 Kb Used 400 144.911/150.112 Kb Used 500 145.221/151.136 Kb Used Assembling (pipe) /Users/{standard input}:2540:suffix or operands invalid for `cmovns' {standard input}:2709:suffix or operands invalid for `cmovns' test/develop/rts/lib/i386-darwin/rtschart.s /Users/test/develop/rts/comp/rtschart.pas(537,41) Fatal: There were 1 errors compiling module, stopping When I simply commented that line, then other completely different kind of line had problem. It seems to me as a bug in actual revision. Any idea what should I do or to which revision to rollback. Thanks in advance. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Conversion between ordinals and pointers is not portable
Hello all, I have this code: TYPE PRDBRecord =^TRDBRecord; TRDBRecord =PACKED RECORD Content :ARRAY [0..65500] OF BYTE; END; VAR MOffset:INTEGER; p :PByteArray; FData :PRDBRecord; ... p := PByteArray (PtrUInt (@FData.Content[0]) + MOffset); ... But the compiler informs about %subj%. How to get rid of this warning and to make code portable? Thanks in advance. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal