Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD
Hi! I do some tests in my FreeBSD 6.1. In another FreeBSD 6.2 I build QT from ports (that is an automated process, that applies some patchs before build). In my FreeBSD 6.1 I build QT without ports (./configure, make, make install) and I got the same result, but with a more detailed backtrace (because QT compiled with debug enabled). I have to change qt43.pas that uses defines LINUX and not UNIX... Fabio Luis Girardi 2007/12/18, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > 6.2 Release disc 1 and 2... > > 2007/12/18, Den Jean <[EMAIL PROTECTED]>: > > > > On Tuesday 18 December 2007 11:39:44 am Jonas Maebe wrote: > > > It appears that you misunderstood the question: he asked *which* > > > FreeBSD, not *why* FreeBSD. > > > > yes what should I download :-) ? 6.2, 6.3RC1 or 7.0BETA4 > > > > ncftp ...FreeBSD/ISO-IMAGES-i386 > ls 6.2 > > 6.2-RELEASE-i386-bootonly.iso 6.2-RELEASE-i386-docs.iso > > 6.2-RELEASE-i386-disc1.iso CHECKSUM.MD5 > > 6.2-RELEASE-i386-disc2.iso CHECKSUM.SHA256 > > ncftp ...reeBSD/ISO-IMAGES-i386 > ls 6.3 > > 6.3-RC1-i386-bootonly.iso 6.3-RC1-i386-disc2.iso > > CHECKSUM.MD5 > > 6.3-RC1-i386-disc1.iso 6.3-RC1-i386-docs.iso > > CHECKSUM.SHA256 > > ncftp ...reeBSD/ISO-IMAGES-i386 > ls 7.0 > > 7.0-BETA4-i386-bootonly.iso7.0-BETA4-i386-docs.iso > > CHECKSUM.SHA256 > > 7.0-BETA4-i386-disc1.iso 7.0-BETA4-i386-livefs.iso > > 7.0-BETA4-i386-disc2.isoCHECKSUM.MD5 > > > > ___ > > 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] MPICH on Pascal
Dear Mattias, Replacing the {$linklib c} with {$IFDEF Unix} {$linklib c} {$ENDIF} It really worked, thanks... Now some other interesting stuff happended, as you probably did on the -l option you created the mpich.dll but the program, even successufully compiled, it doens find the mpich.dll. Here is my tryes: 1) I tryed to compile from the MPICH2 package from the inside of the Lazarus; I got the same error 2) I followed your tutorial on the wiki (http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries) installing the H2Pas and creating the mpich.dll with the mpi.h and mpio.h; it runs but I get: File not Open Press OK to ignore and risk data corruption Press Cancel to kill to program 3) The same thing happens when I try to open the mpich2.h2p file that cames with the lazarus package. Do you know if someone got the same error? Thanks Lourival 2007/12/19, Mattias Gaertner <[EMAIL PROTECTED]>: > On Wed, 19 Dec 2007 13:17:50 -0300 > "Lourival Mendes" <[EMAIL PROTECTED]> wrote: > > >Dear Mattias... sorry to bother again, but as I'm new to Lazarus I > > can't see somethings. > > > >When I loaded the HelloWorld from the examples I got this error: > > > >helloworld.lpr(14,1) Error: Import library not found for c > > > >I do believe that I got this because I'm using the > > > >{$linklib c} > > Replace this with > {$IFDEF Unix} > {$linklib c} > {$ENDIF} > > and try again. > > > Under Windows and this library is for linux... am I right?? So doyou > > know what would be the lib for windows?? > > Maybe the IO functions need some specials under windows. The rest > should work out-of-the-box under windows. > > Mattias > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > -- Lourival J. Mendes Neto ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] getlastoserror giving wrong value?
Hi, when I try to use getlastoserror something "funny" happens. We're dealing with: $ ll /home/marc/program/Test_C/unreadable/ ls: : Permission denied The source: tmp := aFile^ + '/' + dirrec.Name; writeln('file: '+ tmp ); n := fpaccess(tmp , R_OK); writeln(n); n := getlastoserror; writeln(n); The output: file: /home/marc/program/Test_C/unreadable/ -1 -65523 If I do this: program stat; uses baseunix,errors,sysutils; var st: baseunix.stat; res: integer; begin //res := fpstat('/home/marc/program/Test_C/unreadable/', st); res := fpaccess('/home/marc/program/Test_C/unreadable/', R_OK); writeln(res); res := getlastoserror; writeln(res); end. The result is correct: $ ./stat -1 13 and shows ESysEACCES as error number. How can that happen? Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD
On Wednesday 19 December 2007 11:37:33 am [EMAIL PROTECTED] wrote: > I do some tests in my FreeBSD 6.1. In another FreeBSD 6.2 I build QT from > ports (that is an automated process, that applies some patchs before > build). In my FreeBSD 6.1 I build QT without ports (./configure, make, make > install) and I got the same result, but with a more detailed backtrace > (because QT compiled with debug enabled). I tried FreeBSD, but X always seg failed, so then I tried PC-BSD. The qt4 ports install include files to close to qt3 include files (you fall on qt3 files first). The PREFIX stuff does not work. The qt4-gui ports does not link with the PREFIX (does not find libqtcore, whatever you do with ldconfig) If you play with ldconfig, bash becomes unstable-> you cannot launch any program or any new konsole anymore, the messages you get are common problems (google says: update ports recompile everything, but my ports are fresh :-) -> reboot -> I have never rebooted this much :-(.(BSD ? :-) with LD_LIBRARY_PATH and a manually (no ports) compiled qt4 (put in /usr/local/KDE4) I can finally compile lazarus (some pthreads link hurdle aside) lazarus compiled with: #!/bin/bash cd lazarus export LD_LIBRARY_PATH=/usr/local/KDE4/lib gmake LCL_PLATFORM=qt clean all OPT="-dDEBUG -dUSE_QT_4_3 -k'-L/usr/local/KDE4/lib' -k'-lpthread'" qt4intf compiled with: cat ./compile_lib.bash #!/bin/bash export QT4=/usr/local/KDE4 export QT4I=$QT4/include export LD_LIBRARY_PATH=$QT4/lib if [ -e "$LD_LIBRARY_PATH/libQtCore.so.4" ] then g++ -D UNIX -I. -I$QT4I -I$QT4I/Qt -I$QT4I/QtGui -I$QT4I/QtCore -Iqlcl qtpas.cpp -o libqt4intf.so -shared -fPIC -Xlinker $QT4/lib/libQtCore.so.4 $QT4/lib/libQtGui.so.4 "-soname=libqt4intf.so" strip --strip-all libqt4intf.so else echo "Please Modify location of Qt4 in this script" fi lazarus runs, but has continuously exceptions: $2911D9EA $2911E1AA $291417EF $2881BAB8 $082400DE TQTTHEMESERVICES__DRAWELEMENT, line 168 of qtthemes.pas $081BFF95 TCUSTOMSPEEDBUTTON__PAINTBACKGROUND, line 629 of ./include/speedbutton.inc $081BF6B2 TCUSTOMSPEEDBUTTON__PAINT, line 518 of ./include/speedbutton.inc $0819B979 TGRAPHICCONTROL__WMPAINT, line 64 of ./include/graphiccontrol.inc $08060F91 $08191C92 TCONTROL__PERFORM, line 1016 of ./include/control.inc $0818710B TWINCONTROL__PAINTCONTROLS, line 4294 of ./include/wincontrol.inc $08186E66 TWINCONTROL__PAINTHANDLER, line 4233 of ./include/wincontrol.inc QPainter::end: Painter ended with 2 saved states TApplication.HandleException Access violation Stack trace: $28E88EE I also noticed that the gtk2 version crashes when started with ./startlazarus but runs fine when started with ./lazarus ??? so something is wrong ... ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Type declaration
Hi ! I would like to know if there are any differences between these two following declarations : type TMyType = smallint; And type TMyType = type smallint; -- Damien Gerard [EMAIL PROTECTED] People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes. -- (Terry Pratchett, Moving Pictures) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD
I don't remember if I'm running lazaurs with ./startlazarus or ./lazarus, I will see if this ocurs with GTK2.. Yes, QT4 ports don't work, then I build QT4 manualy. My steps: 1) ./configure -prefix /usr/local/ -no-sse2 -no-glib do QT4 install in /usr/local and disable sse2 and GLib suport. 2) gmake, gmake install 3) cd lazaurs, gmake LCL_PLATFORM=qt OPT="-dUSE_QT_4_3" I don't need specify where my QT4 librarys are installed because I put it in /usr/local/(bin, lib, share...) in ./configure... 4) Run ./startlazarus, wait a little time and Have QT4 running with lazarus under FreeBSD 2007/12/20, Den Jean <[EMAIL PROTECTED]>: > > On Wednesday 19 December 2007 11:37:33 am [EMAIL PROTECTED] wrote: > > I do some tests in my FreeBSD 6.1. In another FreeBSD 6.2 I build QT > from > > ports (that is an automated process, that applies some patchs before > > build). In my FreeBSD 6.1 I build QT without ports (./configure, make, > make > > install) and I got the same result, but with a more detailed backtrace > > (because QT compiled with debug enabled). > > I tried FreeBSD, but X always seg failed, so then I tried PC-BSD. > > The qt4 ports install include files to close to qt3 include files (you > fall on qt3 files first). The PREFIX stuff does not work. > The qt4-gui ports does not link with the PREFIX (does not find libqtcore, > whatever you do with ldconfig) > > If you play with ldconfig, bash becomes unstable-> you cannot launch > any program or any new konsole anymore, the messages you get are common > problems > (google says: update ports recompile everything, but my ports are fresh > :-) -> > reboot -> I have never rebooted this much :-(.(BSD ? :-) > > with LD_LIBRARY_PATH and a manually (no ports) compiled qt4 (put in > /usr/local/KDE4) I can finally compile lazarus > (some pthreads link hurdle aside) > > lazarus compiled with: > #!/bin/bash > cd lazarus > export LD_LIBRARY_PATH=/usr/local/KDE4/lib > gmake LCL_PLATFORM=qt clean all OPT="-dDEBUG -dUSE_QT_4_3 > -k'-L/usr/local/KDE4/lib' -k'-lpthread'" > > qt4intf compiled with: > cat ./compile_lib.bash > #!/bin/bash > export QT4=/usr/local/KDE4 > export QT4I=$QT4/include > export LD_LIBRARY_PATH=$QT4/lib > if [ -e "$LD_LIBRARY_PATH/libQtCore.so.4" ] > then > g++ -D UNIX -I. -I$QT4I -I$QT4I/Qt -I$QT4I/QtGui -I$QT4I/QtCore -Iqlcl > qtpas.cpp -o libqt4intf.so -shared -fPIC -Xlinker $QT4/lib/libQtCore.so.4 > $QT4/lib/libQtGui.so.4 "-soname=libqt4intf.so" > strip --strip-all libqt4intf.so > else > echo "Please Modify location of Qt4 in this script" > fi > > > lazarus runs, but has continuously exceptions: > > $2911D9EA > $2911E1AA > $291417EF > $2881BAB8 > $082400DE TQTTHEMESERVICES__DRAWELEMENT, line 168 of qtthemes.pas > $081BFF95 TCUSTOMSPEEDBUTTON__PAINTBACKGROUND, line 629 > of ./include/speedbutton.inc > $081BF6B2 TCUSTOMSPEEDBUTTON__PAINT, line 518 of ./include/speedbutton.inc > $0819B979 TGRAPHICCONTROL__WMPAINT, line 64 > of ./include/graphiccontrol.inc > $08060F91 > $08191C92 TCONTROL__PERFORM, line 1016 of ./include/control.inc > $0818710B TWINCONTROL__PAINTCONTROLS, line 4294 > of ./include/wincontrol.inc > $08186E66 TWINCONTROL__PAINTHANDLER, line 4233 of ./include/wincontrol.inc > QPainter::end: Painter ended with 2 saved states > TApplication.HandleException Access violation > Stack trace: > $28E88EE > > I also noticed that the gtk2 version crashes when started with > ./startlazarus but runs fine when started with ./lazarus ??? > > so something is wrong ... > ___ > 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] getlastoserror giving wrong value?
On 21 Dec 2007, at 06:37, Marc Santhoff wrote: when I try to use getlastoserror something "funny" happens. We're dealing with: $ ll /home/marc/program/Test_C/unreadable/ ls: : Permission denied The source: tmp := aFile^ + '/' + dirrec.Name; writeln('file: '+ tmp ); n := fpaccess(tmp , R_OK); writeln(n); n := getlastoserror; writeln(n); The output: file: /home/marc/program/Test_C/unreadable/ -1 -65523 Regardless of what the real problem is, the above code is wrong: writeln (obviously) also makes use of OS functions to write things out to the screen, and if one of those (temporarily) fails for some reason (e.g., ESysEINTR) then your call to getlastoserror will return the result of that failure. Just like with ioresult, you always have to store the result of getlastoserror immediately in a local variable after the operation you want to check. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] String comparison
Just another question :) What is the most efficient way to check if a string is empty or not ? if s = '' then ... of this one if Length(s) <> 0 then ... -- Damien Gerard [EMAIL PROTECTED] People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes. -- (Terry Pratchett, Moving Pictures) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] String comparison
On Dec 21, 2007, at 2:47 PM, Daniël Mantione wrote: Op Fri, 21 Dec 2007, schreef Damien Gerard: Just another question :) What is the most efficient way to check if a string is empty or not ? if s = '' then ... of this one if Length(s) <> 0 then ... Both generate the same code. Thanks ! -- Damien Gerard [EMAIL PROTECTED] People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes. -- (Terry Pratchett, Moving Pictures) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getlastoserror giving wrong value?
Am Freitag, den 21.12.2007, 13:37 +0100 schrieb Jonas Maebe: > On 21 Dec 2007, at 06:37, Marc Santhoff wrote: > > > when I try to use getlastoserror something "funny" happens. > > > > We're dealing with: > > > > $ ll /home/marc/program/Test_C/unreadable/ > > ls: : Permission denied > > > > The source: > > > > tmp := aFile^ + '/' + dirrec.Name; > > writeln('file: '+ tmp ); > > n := fpaccess(tmp , R_OK); > > writeln(n); > > n := getlastoserror; > > writeln(n); > > > > The output: > > > > file: /home/marc/program/Test_C/unreadable/ > > -1 > > -65523 > > Regardless of what the real problem is, the above code is wrong: > writeln (obviously) also makes use of OS functions to write things > out to the screen, and if one of those (temporarily) fails for some > reason (e.g., ESysEINTR) then your call to getlastoserror will return > the result of that failure. Just like with ioresult, you always have > to store the result of getlastoserror immediately in a local variable > after the operation you want to check. I know and the writeln was inserted later to be sure the system call fails (=-1). If the line is commented out the results are the same in both cases. Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] String comparison
Op Fri, 21 Dec 2007, schreef Damien Gerard: > > Just another question :) > What is the most efficient way to check if a string is empty or not ? > > if s = '' then ... > of this one > if Length(s) <> 0 then ... Both generate the same code. Daniël___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Type declaration
On Dec 21, 2007, at 3:53 PM, ik wrote: Hi, On Dec 21, 2007 3:23 PM, Damien Gerard <[EMAIL PROTECTED]> wrote: Hi ! I would like to know if there are any differences between these two following declarations : type TMyType = smallint; This is an "alias" to smallint, giving it a new way reference it. And type TMyType = type smallint; This is a new type, that have the range of smallint, but they are not the same. If you will place a TMyType variable inside a smallint paremeter you might have an error or warning of type mismatch. I like it :) Thanks ! -- Damien Gerard [EMAIL PROTECTED] People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes. -- (Terry Pratchett, Moving Pictures) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Makefile with fpcmake
I am trying to use fpcmake to compile my fpc programs (console, i386/ OS X Leopard, fpc 2.2.0) ut I've got the following : Shani [milipili] ...ects/Sayuri/trunk/sayuri % fpcmake -Tall - vw 15 :50 #159 FPCMake Version 2.0.0 [2007/12/21] Processing Makefile.fpc Targets: "i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k- amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc- morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc- embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm- linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-embedded" Globals: FPCDIR = "../lib/fpc/2.2.0" PACKAGESDIR = "$(FPCDIR)/packages $(FPCDIR)/packages/base $ (FPCDIR)/packages/extra $(FPCDIR)/packages" UNITSDIR = "$(FPCDIR)/units/$(FULLTARGET)" BASEDIR = "/Users/milipili/Projects/Sayuri/trunk/sayuri" Required packages for linux-i386: rtl Package "rtl": Looking for Makefile.fpc: "../lib/fpc/2.2.0/rtl/ Makefile.fpc ../lib/fpc/2.2.0/packages/rtl/Makefile.fpc ../lib/fpc/ 2.2.0/packages/base/rtl/Makefile.fpc ../lib/fpc/2.2.0/packages/extra/ rtl/Makefile.fpc ../lib/fpc/2.2.0/packages/rtl/Makefile.fpc " Package "rtl": Looking for Package.fpc: "../lib/fpc/2.2.0/rtl/ Package.fpc ../lib/fpc/2.2.0/units/i386-linux/rtl/Package.fpc " Error: Target "linux", package "rtl" not found I use dmg packages from the lazarus mirrors, so I have two separated packages (binaries and sources). I copied the source files (rtl,packages) into the /usr/local/lib/fpc/ 2.2.0/ without any results. Where I am wrong ? PS: My Makefile.fpc [package] name=Sayuri version=0.1 [require] packages= [target] programs=sayuri [compiler] unitdir=languages includedir=. [default] target=all [clean] files=$(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT)) -- Damien Gerard [EMAIL PROTECTED] People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes. -- (Terry Pratchett, Moving Pictures) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Type declaration
Hi, On Dec 21, 2007 3:23 PM, Damien Gerard <[EMAIL PROTECTED]> wrote: > > Hi ! > > I would like to know if there are any differences between these two > following declarations : > > type > TMyType = smallint; This is an "alias" to smallint, giving it a new way reference it. > > And > > type >TMyType = type smallint; This is a new type, that have the range of smallint, but they are not the same. If you will place a TMyType variable inside a smallint paremeter you might have an error or warning of type mismatch. > > > -- > Damien Gerard > [EMAIL PROTECTED] > > People who used magic without knowing what they were doing usually > came to a sticky end. All over the entire room, sometimes. > -- (Terry Pratchett, Moving Pictures) > Ido -- http://ik.homelinux.org/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD
On Friday 21 December 2007 03:06:32 am [EMAIL PROTECTED] wrote: > Den, you want screenshots? Then see... thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] MPICH on Pascal
On Thu, 20 Dec 2007 08:58:49 -0300 "Lourival Mendes" <[EMAIL PROTECTED]> wrote: > Dear Mattias, > > Replacing the {$linklib c} with > {$IFDEF Unix} > {$linklib c} > {$ENDIF} > > It really worked, thanks... > > Now some other interesting stuff happended, as you probably did on > the -l option you created the mpich.dll but the program, even > successufully compiled, it doens find the mpich.dll. > >Here is my tryes: > > 1) I tryed to compile from the MPICH2 package from the inside of the > Lazarus; I got the same error > > 2) I followed your tutorial on the wiki > (http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries) > installing the H2Pas and creating the mpich.dll with the mpi.h and > mpio.h; it runs but I get: h2pas does not create a mpich.dll. > File not Open > > Press OK to ignore and risk data corruption > Press Cancel to kill to program Hmm. Maybe you can create a backtrace for me? http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB > 3) The same thing happens when I try to open the mpich2.h2p file that > cames with the lazarus package. > >Do you know if someone got the same error? No. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal