Recent

Author Topic: Cannot find ncurses unit  (Read 932 times)

Thanos

  • Newbie
  • Posts: 2
Cannot find ncurses unit
« on: September 26, 2022, 09:04:22 am »
Hello everyone. I'm new to Lazarus and object pascal and I have a problem with a console app that cannot find a system unit.
I installed Lazarus 2.2.2 for Win64 on Windows 10 64bit.
I created a test console application:

Code: Pascal  [Select][+][-]
  1. program consol;
  2.  
  3. uses Windows, ncurses;
  4.  
  5. begin
  6.   SetConsoleOutputCP(CP_UTF8);
  7.   writeln('Hello, world.');
  8.   readln;
  9. end.    
  10.  

I get the error message
consol.lpr(3,15) Fatal: Cannot find ncurses used by consol of the Project Inspector.

I see that the unit does exist in the

C:\lazarus\fpc\3.2.2\source\packages\ncurses

directory though.

How can I integrate it so that the compiler sees it?

TIA


KodeZwerg

  • Hero Member
  • *****
  • Posts: 2006
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Cannot find ncurses unit
« Reply #1 on: September 26, 2022, 09:16:01 am »
I do not know about ncurses (on my system that is a package not a unit) but for windows console applications it is a must to add this:
Code: Pascal  [Select][+][-]
  1. program AName;
  2. {$APPTYPE CONSOLE}
  3.  
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: Cannot find ncurses unit
« Reply #2 on: September 26, 2022, 09:20:49 am »
ncurses compilation isn't enabled for Windows, as it is a typical Unix library.

You'd also need ncurses static libraries.


Thaddy

  • Hero Member
  • *****
  • Posts: 14167
  • Probably until I exterminate Putin.
Re: Cannot find ncurses unit
« Reply #3 on: September 26, 2022, 09:22:30 am »
It does not compile under Windows, indeed. But it is a regression, so plz report on the bug tracker.
ncurses needs a proper install of cygwin or similar, though.
« Last Edit: September 26, 2022, 09:25:57 am by Thaddy »
Specialize a type, not a var.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: Cannot find ncurses unit
« Reply #4 on: September 26, 2022, 09:25:32 am »
Hello everyone. I'm new to Lazarus and object pascal and I have a problem with a console app that cannot find a system unit.
I installed Lazarus 2.2.2 for Win64 on Windows 10 64bit.

I suspect that's unix-only, looking at the source it pulls in the ncurses binary library (.so in the case of e.g. Linux, .dll in the case of Windows /if/ such a thing exists).

Why are you trying to use that specific library?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14167
  • Probably until I exterminate Putin.
Re: Cannot find ncurses unit
« Reply #5 on: September 26, 2022, 09:28:42 am »
It is a regression Mark. At least with Cygwin it used to compile, afaik.
I agree with your further remarks.
Specialize a type, not a var.

Thanos

  • Newbie
  • Posts: 2
Re: Cannot find ncurses unit
« Reply #6 on: September 26, 2022, 09:30:56 am »
THanks for the replies everyone.


Why are you trying to use that specific library?

MarkMLl

I'm trying my hand on cross platform apps. I want it to compile on both Win 10 and Linux. And probably it will be run through an SSH connection to a server.

It does not compile under Windows, indeed. But it is a regression, so plz report on the bug tracker.
THank you. Will do.

Thaddy

  • Hero Member
  • *****
  • Posts: 14167
  • Probably until I exterminate Putin.
Re: Cannot find ncurses unit
« Reply #7 on: September 26, 2022, 09:40:45 am »
Note that under Windows I believe there is also a dependency on msvcrt.dll but that is almost always available.
Specialize a type, not a var.

beria

  • Jr. Member
  • **
  • Posts: 70
Re: Cannot find ncurses unit
« Reply #8 on: September 26, 2022, 11:46:13 am »
Hello everyone. I'm new to Lazarus and object pascal and I have a problem with a console app that cannot find a system unit.
I installed Lazarus 2.2.2 for Win64 on Windows 10 64bit.
I created a test console application:

Code: Pascal  [Select][+][-]
  1. program consol;
  2.  
  3. uses Windows, ncurses;
  4.  
  5. begin
  6.   SetConsoleOutputCP(CP_UTF8);
  7.   writeln('Hello, world.');
  8.   readln;
  9. end.    
  10.  

I get the error message
consol.lpr(3,15) Fatal: Cannot find ncurses used by consol of the Project Inspector.

I see that the unit does exist in the

C:\lazarus\fpc\3.2.2\source\packages\ncurses

directory though.

How can I integrate it so that the compiler sees it?

TIA
Code: Pascal  [Select][+][-]
  1. program consol;
  2. begin
  3.   writeln('Hello, world.');
  4.   readln;
  5. end.  
  6.  



« Last Edit: September 26, 2022, 11:48:59 am by beria »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: Cannot find ncurses unit
« Reply #9 on: September 26, 2022, 01:29:47 pm »
It does not compile under Windows, indeed. But it is a regression, so plz report on the bug tracker.
ncurses needs a proper install of cygwin or similar, though.

Cygwin is not a supported target. The ncurses library is not available as a non-Cygwin library, so no, it's not supposed to be enabled, thus it's no regression.

Arioch

  • Sr. Member
  • ****
  • Posts: 421
Re: Cannot find ncurses unit
« Reply #10 on: September 26, 2022, 02:00:34 pm »
The ncurses library is not available as a non-Cygwin library

This is a bit too generic. MSYS2 has it (c:\Git\usr\bin\msys-ncursesw6.dll ), and probably every other UNIX-like environment for Windows too.

But it is not part of native Windows native support for sure.
Just like Lazarus for Linux would hardly include immediate suport for Windows-specific libraries from WinE


PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: Cannot find ncurses unit
« Reply #11 on: September 27, 2022, 09:56:27 am »
But it is not part of native Windows native support for sure.

Yes, should have said as a “native Windows library” without Cygwin, MSYS or whatever. ;)

 

TinyPortal © 2005-2018