Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD

2007-12-12 Thread [EMAIL PROTECTED]
I ran qt4 demos and all right! Lazarus demos crash...

Attached is the backtrace of lazarus and ldd of lazarus example (hello).

I will update my lazarus to a recent snapshot...


Fabio Luis Girardi


2007/12/11, Den Jean <[EMAIL PROTECTED]>:
>
> On Tuesday 11 December 2007 08:05:49 pm [EMAIL PROTECTED] wrote:
> > Attached the script that build libqt4intf.so in FreeBSD (test)
>
> try to run the demoes of c++ qt4
> e.g.
> cd qt-x11-opensource-src-4.3.1/demos/textedit
> ./textedit
>
>
> try to build the demo of the fpc qt4 bindings and run those
>
> make sure you do not have 2 Qt's mixed in the library paths.
> Although different versions are claimed to be compatible, a
> different ./configure by distrib vendor may even make a same
> version a completely different Qt lib.
>
> There is a help about in the bindings mainwindow demo that gives the Qt
> version.
>
> use ldd to find the the path of the used lib on your system
>
> ldd ./mainwindow | grep -i qt
> libqt4intf.so => /usr/lib/libqt4intf.so (0xb7d3f000)
> libQtCore.so.4 => /usr/lib/qt4/lib/libQtCore.so.4 (0xb7a6f000)
> libQtGui.so.4 => /usr/lib/qt4/lib/libQtGui.so.4 (0xb72b2000)
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
%gdb ./lazarus
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) run
Starting program: /usr/home/fabiolg/lazarus/lazarus
warning: Unable to get location for thread creation breakpoint: generic error
[New LWP 100086]
TApplication.IconChanged - TODO: convert this message...no implementation in 
gtk or win32
[New Thread 0x893 (LWP 100155)]
NOTE: codetools config file not found - using defaults

NOTE: FPC Source Directory not set! (see Environment Options)
[New Thread 0x8930200 (LWP 100137)]
TDefinePool.CreateFPCSrcTemplate FPCSrcDir does not exist: FPCSrcDir=""

NOTE: Could not create Define Template for Free Pascal Sources
NOTE: help options config file not found - using defaults
TMainIDE.DoNewProject A
TMainIDE.DoNewEditorFile A NewFilename=
[TCustomFormEditor.CreateComponent] Class='TForm'
TMainIDE.DoNewEditorFile end unit1.pas

Program received signal SIGBUS, Bus error.
[Switching to Thread 0x893 (LWP 100128)]
$28cf59fa in qt_memfill32_sse2 () from /usr/local/lib/libQtGui.so.4
(gdb) backtrace
#0  $28cf59fa in qt_memfill32_sse2 () from /usr/local/lib/libQtGui.so.4
#1  $28d7abe2 in QImage::fill () from /usr/local/lib/libQtGui.so.4
#2  $28dc2561 in QPainterPrivate::draw_helper () from 
/usr/local/lib/libQtGui.so.4
#3  $28dc41f9 in QPainter::drawRects () from /usr/local/lib/libQtGui.so.4
#4  $28dc42b0 in QPainter::fillRect () from /usr/local/lib/libQtGui.so.4
#5  $28f4e6ec in qt_plastique_draw_gradient () from /usr/local/lib/libQtGui.so.4
#6  $28f4f56c in qt_plastique_drawShadedPanel () from 
/usr/local/lib/libQtGui.so.4
#7  $28f6e634 in QPlastiqueStyle::drawPrimitive () from 
/usr/local/lib/libQtGui.so.4
#8  $286afab8 in QStyle_drawPrimitive () from /usr/local/lib/libqt4intf.so
#9  $081cb4f0 in TQTTHEMESERVICES__DRAWELEMENT (DC=703139136, DETAILS={ELEMENT 
= TETOOLBAR, PART = 1, STATE = 1}, R=
{LEFT = 0, TOP = 0, RIGHT = 23, BOTTOM = 22, TOPLEFT = {X = 0, Y = 0}, 
BOTTOMRIGHT = {X = 23, Y = 22}}, CLIPRECT=$0, this=$295c05a0)
at qtthemes.pas:168
#10 $08172274 in TCUSTOMSPEEDBUTTON__PAINTBACKGROUND (PAINTRECT=
{LEFT = 0, TOP = 0, RIGHT = 23, BOTTOM = 22, TOPLEFT = {X = 0, Y = 0}, 
BOTTOMRIGHT = {X = 23, Y = 22}}, this=$29a74400)
at speedbutton.inc:614
#11 $08171c0c in TCUSTOMSPEEDBUTTON__PAINT (this=$29a74400) at 
speedbutton.inc:502
#12 $08158980 in TGRAPHICCONTROL__WMPAINT (MESSAGE={MSG = 1056, DC = 703139136, 
PAINTSTRUCT = $0, RESULT = 0}, this=$29a74400)
at graphiccontrol.inc:64
#13 $08060681 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#14 $081588ec in TGRAPHICCONTROL__DESTROY (vmt=$bfbfd410, this=$29a74400) at 
graphiccontrol.inc:46
#15 $0815183c in TCONTROL__PERFORM (MSG=1056, WPARAM=703139136, LPARAM=0, 
this=$29a74400) at control.inc:1015
#16 $08149cff in TWINCONTROL__PAINTCONTROLS (DC=703139136, FIRST=$0, 
this=$29790610) at wincontrol.inc:4259
#17 $08149acf in TWINCONTROL__PAINTHANDLER (THEMESSAGE={MSG = 1056, DC = 
703139136, PAINTSTRUCT = $29d5ccb0, RESULT = 0}, this=$29790610)
at wincontrol.inc:4198
#18 $0814ca1a in TWINCONTROL__WMPAINT (MSG={MSG = 1056, DC = 703139136, 
PAINTSTRUCT = $29d5ccb0, RESULT = 0}, this=$29790610)
at wincontrol.inc:5930
#19 $08158d23 in TCUSTOMCONTROL__WMPAINT (MESSAGE={MSG = 1056, DC = 703139136, 
PAINTSTRUCT = $29d5ccb0, RESULT = 0}, this=$29790610)
at customcontro

Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD

2007-12-12 Thread Den Jean
On Wednesday 12 December 2007 07:33:15 pm Den Jean wrote:
> do you have a sse2 capable processor ?

compile and run pure pascal (no qt or lazarus) program below to check anyhow
(more verbose version of testsse2 of svn/fpctrunk/tests/test/testsse2.pp)

{ %OPT=-OaVARMAX=16 -OaVARMIN=16 }
{ %CPU=i386 }
uses
   mmx;

{ only a small test to see if it works in principle }

var
  b : byte;
  q : array[0..15] of byte;

begin
  if is_sse2_cpu then
begin
writeln('executing sse2 instructions ...');
asm
{$ifdef FPC_PIC}
   call .LPIC
.LPIC:
   popl %ecx
{$ifdef darwin}
   movdqa%xmm1,%xmm2
   movdqaq-.LPIC(%ecx),%xmm4
   psubq %xmm1,%xmm2
   psubq q-.LPIC(%ecx),%xmm4
{$else darwin}
   addl  $_GLOBAL_OFFSET_TABLE_,%ecx
   movdqa%xmm1,%xmm2
   movdqa[EMAIL PROTECTED](%ecx),%xmm4
   psubq %xmm1,%xmm2
   psubq [EMAIL PROTECTED](%ecx),%xmm4
{$endif darwin}
{$else FPC_PIC}
   movdqa%xmm1,%xmm2
   movdqaq,%xmm4
   psubq %xmm1,%xmm2
   psubq q,%xmm4
{$endif FPC_PIC}
end;
end else writeln('not sse2 cpu');
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD

2007-12-12 Thread Den Jean
On Wednesday 12 December 2007 12:24:02 pm [EMAIL PROTECTED] wrote:
> $28cf59fa in qt_memfill32_sse2 () from /usr/local/lib/libQtGui.so.4

do you have a sse2 capable processor ?

http://en.wikipedia.org/wiki/SSE2

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] help with serial.pp unit please

2007-12-12 Thread Graeme Geldenhuys
Hi,

I'm trying to write a Phone Dialer feature in my application.  I
managed to do this a long time ago in a Delphi app using Windows API
calls, but now I need it for Linux and Windows.  Unfortunately the
serial.pp unit is not documented and searching the FPC src directory
didn't yield any examples either.

So the code below is a shot in the dark.  Could anybody familiar with
the serial.pp unit comment please.  If I get this working, maybe it
can serve as a simple example of using the serial.pp unit?


A few notes and questions:

1.  ComPortToString will create a string containing the selected com
port of the OS.  eg Linux = '/dev/tty0'   or under Windows = 'COM1'

2.  What status codes does SerWrite() return?  What are valid/invalid codes?

3.  Does my 'hangup the phone' string look correct?


-[ Start ]--
try
  s := ComPortToString;
  serialhandle := SerOpen(s);
  s := 'ATDT' + FNumberToDial + #13+#10;   //Create a string to
send to modem.
  writecount := 0;
  status := SerWrite(serialhandle, s, writecount);

  // The next line is for debugging only!
  writeln('status: ', status, '   writecount: ', writecount);

  if status > 0 then  // What am I supposed to test for???
  begin
//Hide;
ShowMessage('Pick up the phone.' + #13 + 'Click OK after
dialing has completed.');
s := 'ATH^M^J';
status := SerWrite(serialhandle, s, writecount);
  end
  else
ShowMessage('Unable to dial number.');
finally
  SerClose(serialhandle);
end;
-[ END ]--


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal