Recent

Author Topic: Strange error compiling Asphyre in degug mode, but not in release mode  (Read 1446 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 576
Hi, I downloaded Asphyre from its page https://asphyre.net/8-news/20-platform-extended-library-re-licensed-under-mpl

I compile the basic example, using default mode in lazarus, and it's works nice but if I change to debug mode in lazarus I got a compile error:
Quote
PXL.Devices.DX9.pas(161,15) Error: Incompatible type for arg no. 2: Got "Class Of IDirect3D9Ex", expected "TClass"
The error is in unit PXL.Devices.DX9.
This is the line:
 
Code: [Select]
   if Failed(IDirect3D9Ex(FContext.Direct3D).GetAdapterDisplayModeEx(D3DADAPTER_DEFAULT, @DisplayModeEx, nil)) then
      Exit(False);   
Why this problem?
/BlueIcaro
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3610
  • I like bugs.
Re: Strange error compiling Asphyre in degug mode, but not in release mode
« Reply #1 on: September 17, 2018, 08:12:39 pm »
I compile the basic example, using default mode in lazarus, and it's works nice but if I change to debug mode in lazarus I got a compile error:
Quote
PXL.Devices.DX9.pas(161,15) Error: Incompatible type for arg no. 2: Got "Class Of IDirect3D9Ex", expected "TClass"
It is clearly a compilation error and has nothing to do with debugging. Do you mean that "debug" build mode makes a difference here? It shouldn't.
I didn't look at the actual code yet, sorry.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 576
Re: Strange error compiling Asphyre in degug mode, but not in release mode
« Reply #2 on: September 17, 2018, 08:29:37 pm »
Hi, I found that the problem with the option "Verify method calls" in debuging option.
If I remove this option the code can be compiled.
Debug mode actives this option, and this is the problem.
May be same expert in free pascal compiler can explain it, I don't know why, but now I can use break points and debug.

/BlueIcaro

Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3610
  • I like bugs.
Re: Strange error compiling Asphyre in degug mode, but not in release mode
« Reply #3 on: September 17, 2018, 09:42:54 pm »
Hi, I found that the problem with the option "Verify method calls" in debuging option.
Ok, yes. Lazarus itself has similar problems:
 https://bugs.freepascal.org/view.php?id=11697
Even the often used accessor class hacks can trigger it.

" -CR Generate checks when calling methods to verify if the virtual method table for that object is valid. "