Recent

Author Topic: LazSqlX  (Read 143659 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #135 on: October 02, 2014, 02:44:36 pm »
Small bug seems to be present in connection dialog for Firebird: the tedit for database server does not appear so you cannot specify a server (only a database and port)

Additionally, you could remove all .ppu, .o, backup files from the repository (git delete or something) as they are automatically generated by the compiler anyway...
This will cut down on diffs etc.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #136 on: October 20, 2014, 12:13:12 pm »
(Just wanted to vent - solutions welcome of course)

Been having huge problems debugging lazsqlx.
First used laz trunk/fpc trunk; decided to move to laz trunk/fpc 2.6.4 to avoid potential issues with temporarily bad code.

First changed project options manifest permission level from As Administrator to As Invoker otherwise gdb cannot attach to process and/or lazsqlx gui does not show

Then set breakpoints and tried to run. GDB complained about "cannot insert breakpoint" => found an earlier post and workaround by Martin: http://forum.lazarus.freepascal.org/index.php/topic,20066.msg115300.html#msg115300 => use external linker instead of internal.

Did that, then started. Now I get this error @?#$??@
LazSqlX.exe - Entry Point Not Found
The procedure entry point SwapBuffers could not be located in the dynamic link library opengl32.dll

Why (and where) is LazSQLX messing with opengl?
Edit: searching a bit seems to indicate it's actually Windows gdi32 that calls opengl swapbuffers...
« Last Edit: October 20, 2014, 12:29:34 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

flamer0n

  • Guest
Re: LazSqlX
« Reply #137 on: October 20, 2014, 01:16:53 pm »
Unfortunately I have no clue. I don't remember I ever needed to use it in Lazsqlx.  I scanned the import segment in exe and there doesn't seem to import opengl32, only gdi (at least statically).  Could it be that [Enabled DPI Awareness for Vista+] in project options has something to do with this?

Edit: I searched the sources for any accidental use of gl,glu,glut,glext (I don't know if any other unit loads "OpenGL32.dll")  but nothing found in LazSqlX sources.
« Last Edit: October 20, 2014, 01:31:39 pm by flamer0n »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: LazSqlX
« Reply #138 on: October 20, 2014, 01:55:17 pm »
One would expect GDI to be directx based. 

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #139 on: October 20, 2014, 04:28:19 pm »
@flamer0n: thanks; disabling dpi awareness does not change anything.

One would expect GDI to be directx based. 
It apparently isn't here if I understand e.g. this
http://stackoverflow.com/questions/20645706/why-are-functions-duplicated-between-opengl32-dll-and-gdi32-dll
correctly.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: LazSqlX
« Reply #140 on: October 20, 2014, 04:48:42 pm »
It apparently isn't here if I understand e.g. this
http://stackoverflow.com/questions/20645706/why-are-functions-duplicated-between-opengl32-dll-and-gdi32-dll
correctly.
[/quote]

That is for OpenGL and GDI interoperation, IOW to be able to render opengl on GDI handles. (read anything but full screen).  IOW that is opengl -> GDI  not GDI -> opengl.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #141 on: October 20, 2014, 05:00:57 pm »
Sigh.
Search in Lazarus sources on SwapBuffers gives only opengl related units (and fpvectorial, customdrawn android, OSX carbon).

FPC sources: opengl related units, ptc, sdl some OSX stuff and also jwawingdi.pas - but that apparently isn't called from Lazarus anyway (see above)... and
windows func.inc
Code: [Select]
function SwapBuffers(DC:HDC):WINBOOL; external 'gdi32' name 'SwapBuffers';
... but as the Lazarus search above doesn't give any relevant results this isn't called either I suppose...

Testing on Win XP virtual machine doesn't give this error but this instead:
LazSqlX - Entry Point Not Found
The procedure entry point ConvertThreadToFiberEx could not be located in the dynamic link library kernel32.dll
Edit: MSDN indicates this function is Vista+ so not surprising

Ran depends.exe on XP on the image which did show an opengl dependency IIUC... IIUC, swapbuffers is needed but cannot be found either...
See https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/lazsqlx_depends.txt
« Last Edit: October 20, 2014, 05:15:23 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #142 on: October 20, 2014, 05:12:18 pm »
That is for OpenGL and GDI interoperation, IOW to be able to render opengl on GDI handles. (read anything but full screen).  IOW that is opengl -> GDI  not GDI -> opengl.
OK thanks
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #143 on: October 20, 2014, 05:18:36 pm »
... and the only place in Laz or FPC where ConvertThreadToFiberEx occurs is in FPC's jwawinbase.pas...

Strange?!?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #144 on: October 20, 2014, 05:28:18 pm »
Wierdliness.   On the surface, none of this makes sense.   

In an earlier post you mentioned .o and. ppus were in the project.  Hate to ask the bleeding obvious,  but did you try a clean directory first?
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #145 on: October 20, 2014, 05:29:01 pm »
Dunno. At some point yes. But can't remember if I did that before or after enabling the external linker.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #146 on: October 21, 2014, 05:55:02 am »
@BigChimp: I'm not seeing any issues at all.  Well none that I wasn't expecting...

I downloaded the code from https://github.com/flakron-shkodra/LazSqlX.git (chose Clone in desktop)

I already had Zeos installed (Zeos Trunk, whatever version that is).  Run - Run (wanted to see what happened out of the box) (Note: I did nothing with Project Options)

Two exceptions, both related to the fact that I didn't have my compile folder populated with the required files. 

First was an exception in TAnimatedGIF.  Application handled the exception and allowed me to proceed (fair enough, a missing animated GIF shouldn't be a showstopper, but I bet this was your graphics link...), so I went to connect to a database.  The second exception I was anticipating and was raised relating to missing ms sql dll. 

Exited the Application.  Put a break point in MainFormU FormCreate.  Run - run.  Breakpoint correctly reached.

I note that the project is being actively worked on by @Flameron.  Maybe your copy was stale?   Try getting latest, see if that does the trick...

UPDATE:  A thought occurred relating to the .o/.ppus shipped with the code.  I've now cleaned directories, and built all from scratch.  Still no issues and breakpoints working fine...

Alternatively, it's the build environment somehow.  I did my testing with Laz Trunk/fpc Trunk.  I don't have Laz Trunk/fpc 2.6.4 configured anywhere.  If you get latest and that still doesn't work, I'll use that fantastic tool fpcup and get me a Trunk/2.6.4 setup and see what happens :-)
« Last Edit: October 21, 2014, 06:12:06 am by Mike.Cornflake »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #147 on: October 21, 2014, 07:34:03 am »
Yes, things may well be corrupted here. But why (as in: it shouldn't happen). I'm first going to have a quick look at whether I can see what libraries the linker wants to link in to see if there's anything odd there.

Could you try testing setting the linker to the external linker by setting -Xe in project options/other and see if debugging/running is ok?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #148 on: October 21, 2014, 07:50:17 am »
Bingo: with the external linker (-Xe), passing --verbose to the linker, I get this output:
Code: [Select]
...
attempt to open C:\development\fpc264\units\i386-win32\winunits-jedi\jwawinuser.o succeeded
C:\development\fpc264\units\i386-win32\winunits-jedi\jwawinuser.o
attempt to open C:\development\fpc264\units\i386-win32\winunits-jedi\jwawinbase.o succeeded
C:\development\fpc264\units\i386-win32\winunits-jedi\jwawinbase.o
attempt to open C:\development\fpc264\units\i386-win32\winunits-jedi\jwawingdi.o succeeded
C:\development\fpc264\units\i386-win32\winunits-jedi\jwawingdi.o
attempt to open C:\development\fpc264\units\i386-win32\winunits-jedi\jwawinnt.o succeeded
C:\development\fpc264\units\i386-win32\winunits-jedi\jwawinnt.o
attempt to open C:\development\fpc264\units\i386-win32\winunits-jedi\jwawintype.o succeeded
C:\development\fpc264\units\i386-win32\winunits-jedi\jwawintype.o
attempt to open C:\development\fpc264\units\i386-win32\winunits-jedi\jwantstatus.o succeeded
C:\development\fpc264\units\i386-win32\winunits-jedi\jwantstatus.o
...
So it looks like those jedi units get included somehow... and called?!?

I'll copy my local changes, pull lazsqlx from git, and copy back my local changes... see what happens then.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #149 on: October 21, 2014, 08:09:48 am »
Yes, things may well be corrupted here. But why (as in: it shouldn't happen). I'm first going to have a quick look at whether I can see what libraries the linker wants to link in to see if there's anything odd there.

Could you try testing setting the linker to the external linker by setting -Xe in project options/other and see if debugging/running is ok?

I get the same as you.

This is the first time I've ever tried running with an external linker.  Are you sure this functionality is working generally?

Quote
LazSqlX.exe - Entry Point Not Found
---------------------------
The procedure entry point SwapBuffers could not be located in the dynamic link library opengl32.dll.

During application load, LazSQLx tries to display an animated GIF (called Loading.gif).  (Have a look in AnimatedGIF.pas).  At first I thought the exception was due to the GIF not being in my compile folder, but on closer look, it's a resource shipped with the exe, the file exists, but the header isn't recognised by TGraphic which is why we've never seen that GIF before...  The exception is handled...  Bet you that's the source of the error. 

It's a shame that animated GIF isn't working, there's some fairly thorough and extensive code in Animated GIF, including a complete loader...

(And while LazSQLx itself doesn't directly call jwawinuser, bet it's got something to do with fpc and it registers a filetype with TGraphic... (Random Guess))
« Last Edit: October 21, 2014, 08:17:24 am by Mike.Cornflake »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

 

TinyPortal © 2005-2018