* * *

Author Topic: [SOLVED] Cannot find Win32Int used by Interfaces, incompatible ppu  (Read 2200 times)

VitalArt

  • New member
  • *
  • Posts: 24
Hello.
This problem arose out of another, which I posted about at https://forum.lazarus.freepascal.org/index.php/topic,39990.0.html, but I guess it ended up in the wrong subforum. The problem is as follows:

1)I needed the TBitMap class out of Graphics unit. Turns out it doesn't function properly without the inclusion of the Interfaces unit. But when I include the Interfaces unit (and add LCL to dependencies), the project fails to compile with the following message:
 
Code: Pascal  [Select]
  1. win32int.pp(8,84) Fatal: Cannot find Win32Int used by Interfaces, incompatible ppu=C:\lazarus\lcl\units\x86_64-win64\win32\win32int.ppu, package LCL
  The ppu is there, target and fpc version didn't change. Lazarus sees the win32int.pp.
2)I try to recompile win32int.ppu by manually adding C:\lazarus\lcl\interfaces\win32\ to project paths. It appears to find it only to fail on the following:
 
Code: Pascal  [Select]
  1. win32callback.inc(1237,17) Error: identifier idents no member "IsSurrogate"
3)I try to recreate the same situation in an empty project, but cannot.
4)I try to move the Interfaces unit in the uses clause around or move it the main .lpr file completely. The problem persists.
5)I try to create a new project from scratch and then transfer my source files there. The problem persists.
6)If I do a Clean + Build it appears as though the file win32callback.inc is compiled two times for some reason: during LCL build it's successful, and then during the final .exe build it fails with the aforementioned error.

What direction do I even start digging towards to fix this?
« Last Edit: February 07, 2018, 05:34:43 pm by VitalArt »

wp

  • Hero Member
  • *****
  • Posts: 5055
Re: Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #1 on: February 06, 2018, 10:39:02 pm »
You seem to try to use unit graphics in a console program. I doubt if this will work. Write a gui program instead ("File" > "New" > "Project" > "Application"), and everything will be found correctly. Or avoid using graphics altogether. fcl-image provides image classes without the graphics unit: http://wiki.freepascal.org/fcl-image
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

VitalArt

  • New member
  • *
  • Posts: 24
Re: Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #2 on: February 07, 2018, 11:48:59 am »
Quote
Write a gui program instead ("File" > "New" > "Project" > "Application")
Nope, doesn't help. Same error.
I already suspected it wouldn't help since, again, if I create a new project even with a 'simple program' option, it all works fine.
I also tried creating an 'Application' project and transferring all my sources to there, and it fails to compile even when I strip it down to only the .lpr with no code! I'm starting to suspect that this problem will turn out to have a really stupid cause.
Also, now that I did that, I notice the following warning:
Code: Pascal  [Select]
  1. Warning: Recompiling Win32Int, checksum changed for Character

wp

  • Hero Member
  • *****
  • Posts: 5055
Re: Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #3 on: February 07, 2018, 12:09:12 pm »
Something is badly wrong here. Please post the program which is not working. (all source files, no compiler-generated files, all packed into a common zip which is accepted by the forum software for upload under "Attachments and other options").
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

engkin

  • Hero Member
  • *****
  • Posts: 2117
Re: Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #4 on: February 07, 2018, 04:18:42 pm »
Also, now that I did that, I notice the following warning:
Code: Pascal  [Select]
  1. Warning: Recompiling Win32Int, checksum changed for Character

Do you have a unit in your source code called Character? If yes, you need to rename it. And delete its .o/.ppu files

VitalArt

  • New member
  • *
  • Posts: 24
Re: Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #5 on: February 07, 2018, 05:34:17 pm »
Oof, this one burns. I thought the problem was stupid, but not that stupid.
Turns out, I really had a unit called Character which was not even doing anything and which I've completely forgot about. My excuse is that I started this project 2 years ago and haven't come back to it in a year. The unit was just sitting in a uses clause in a part of code I haven't revisited since the beginning and just doing nothing.
Anyway, now everything works fine and I don't even need to keep LCL in dependencies.

One last question: so there can never be two units with the same name in a project or is there some way to manage this?
Thanks for your input.

Bart

  • Hero Member
  • *****
  • Posts: 3128
    • Bart en Mariska's Webstek
Re: [SOLVED] Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #6 on: February 07, 2018, 06:24:55 pm »
Namespaces?

engkin

  • Hero Member
  • *****
  • Posts: 2117
Re: Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #7 on: February 08, 2018, 03:41:04 am »
so there can never be two units with the same name in a project or is there some way to manage this?
No. Do not use the same name. There is a way to prevent name conflict with the RTL if you compile the RTL with -Ur, according to the docs:
Quote
      -Ur        Generate release unit files (never automatically recompiled) 

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6584
Re: [SOLVED] Cannot find Win32Int used by Interfaces, incompatible ppu
« Reply #8 on: February 08, 2018, 04:41:56 pm »
Note that will still not allow the same units into the same project.

-Ur mainly protects against recompilation in the case of duplicate .inc files.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus