Recent

Author Topic: [Solved] Fatal: Cannot open include file "daemonapp.inc"  (Read 855 times)

vonda

  • Newbie
  • Posts: 2
[Solved] Fatal: Cannot open include file "daemonapp.inc"
« on: March 30, 2023, 01:54:34 pm »
Hi,
I am new to Lazarus and Freepascal. I am trying to make a service following this: https://wiki.freepascal.org/Daemons_and_Services

I downloaded the source code. But when I try to build "TestDaemonCodeOnly", I get error:
Code: Pascal  [Select][+][-]
  1. Compile Project, Mode: Release, Target: x86_64-win64\Release\TestDaemonCodeOnly.exe: Exit code 1, Errors: 1
  2. daemonapp.pp(461,2) Fatal: Cannot open include file "daemonapp.inc"

I have Windows 11, I have installed the lazdaemon package and I have added the folder with "daemonapp.inc" file into Project options -> Paths -> Other unit files.

Can you please suggest what can be wrong?
« Last Edit: March 31, 2023, 08:24:11 am by vonda »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Fatal: Cannot open include file "daemonapp.inc"
« Reply #1 on: March 30, 2023, 03:15:38 pm »
You included the FPC source directory into your unit path, or you have a duplicate daemonapp.pp somewhere.

Standard, FPC uses precompiled files rather than source directories.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Fatal: Cannot open include file "daemonapp.inc"
« Reply #2 on: March 30, 2023, 03:40:37 pm »
I have Windows 11, I have installed the lazdaemon package and I have added the folder with "daemonapp.inc" file into Project options -> Paths -> Other unit files.
Did you add the lazdaemon package to the requirements of the project (Project options, "Add" > "New requirement" > select "lazdaemon" in the packages listbox > "OK")? In Lazarus, access to libraries is made via packages, not by extending the unit search path like in Delphi - leave the "Paths" > "Other units files" alone unless you know what you are doing or you structured your project files in subdirectories. After fixing this, do a "Run" > "Build" in order to delete the project output directory from the previous compilation attempts.

vonda

  • Newbie
  • Posts: 2
Re: Fatal: Cannot open include file "daemonapp.inc"
« Reply #3 on: March 31, 2023, 08:22:54 am »
Thank you very much, for your help.

Adding the package as requirement and removing everything from "Other units" paths helped.

Just for anyone facing the same problem, the requirements can be set in Project -> Project Inspector... -> Add -> New requirement.

 

TinyPortal © 2005-2018