Recent

Author Topic: Light weighted IDE for Freepascal  (Read 2329 times)

TRon

  • Hero Member
  • *****
  • Posts: 3300
Re: Light weighted IDE for Freepascal
« Reply #15 on: August 06, 2024, 11:45:37 am »
I tried notepad++,it works for a very simple source just with unit sysutils,generics.collections.But if I tried to use lconvEncoding,the compiler just complaints:

As I already wrote and explained here in your other thread ...

The RTL and FCL are part of the FPC command-line compiler and as such are configured correctly (or at least should be). Lazarus and its LCL is an entirely different thing and that is the whole reason the Lazarus IDE and its package system exists in the first place.

If you explicitly want to make use of Lazarus specific units using only the FPC command-line compiler then you are required to configure FPC accordingly.

So, edit your fpc.cfg file and add the line:
Code: [Select]
-Fu<path/to/your/lazarus/installation>/components/lazutils/lib/$fpctarget
Where <path/to/your/lazarus/installation> needs to be replaced to match your own setup.

This needs to be done for every (individual) LCL package that you wish to make use of but, keep in mind that Lazarus uses several locations to "store" its units so the post-fixed part of the path also differs depending on which unit/package your Free Pascal source wants to make use of.

The example as shown is only to fix the missing lconvEncoding unit message/

As I also wrote in that message, if you are writing GUI applications using the LCL then simply don't do it this way as it isn't worth the time (you'll figure that out eventually when code is starting to make use of of 3th party packages/components).

Quote
In Lazarus ,I just did one more thing: project inspector -> Required Package, searched and added LCL.Everything goes fine.
Yes, because Lazarus takes all that burden away from the user. All package specific settings are part of that package, and that includes the required unit paths. So in Lazarus adding a dependency is enough to make things work as intended.
This tagline is powered by AI

PeterHu

  • New Member
  • *
  • Posts: 20
Re: Light weighted IDE for Freepascal
« Reply #16 on: August 06, 2024, 12:06:54 pm »
I tried notepad++,it works for a very simple source just with unit sysutils,generics.collections.But if I tried to use lconvEncoding,the compiler just complaints:

As I already wrote and explained here in your other thread ...

The RTL and FCL are part of the FPC command-line compiler and as such are configured correctly (or at least should be). Lazarus and its LCL is an entirely different thing and that is the whole reason the Lazarus IDE and its package system exists in the first place.

If you explicitly want to make use of Lazarus specific units using only the FPC command-line compiler then you are required to configure FPC accordingly.

So, edit your fpc.cfg file and add the line:
Code: [Select]
-Fu<path/to/your/lazarus/installation>/components/lazutils/lib/$fpctarget
Where <path/to/your/lazarus/installation> needs to be replaced to match your own setup.

This needs to be done for every (individual) LCL package that you wish to make use of but, keep in mind that Lazarus uses several locations to "store" its units so the post-fixed part of the path also differs depending on which unit/package your Free Pascal source wants to make use of.

The example as shown is only to fix the missing lconvEncoding unit message/

As I also wrote in that message, if you are writing GUI applications using the LCL then simply don't do it this way as it isn't worth the time (you'll figure that out eventually when code is starting to make use of of 3th party packages/components).

Quote
In Lazarus ,I just did one more thing: project inspector -> Required Package, searched and added LCL.Everything goes fine.
Yes, because Lazarus takes all that burden away from the user. All package specific settings are part of that package, and that includes the required unit paths. So in Lazarus adding a dependency is enough to make things work as intended.

I make it,thank you!Thank you!This helped me a lot ,it is getting clearer & closer in my mind comparing to the compiling process in a C enviroment for me to understand.And I don't think I will do this in a GUI project,and,the compiler also mentions only one source file supported to do so.

One more question,does it add lconvEncoding.o or lconvEncoding.ppu?
« Last Edit: August 06, 2024, 12:16:52 pm by PeterHu »

TRon

  • Hero Member
  • *****
  • Posts: 3300
Re: Light weighted IDE for Freepascal
« Reply #17 on: August 06, 2024, 12:59:34 pm »
I make it,thank you!
Your most welcome.

Perhaps the following might be helpful then as well: have a look here at the listing and description of the FPC command-line options. All options provided in the fpc.cfg file can also be passed at the command-line. That is very convenient when f.e. you want to quickly add a unit directory or test things.

For example the option -vt tells the compiler to show which files and directories it tried to locate certain files (and if that succeeded or failed) including what file is being looked for by the compiler.

Quote
One more question,does it add lconvEncoding.o or lconvEncoding.ppu?
Add to what exactly ?

The -Fu options defines a path to a single or multiple units (.ppu file(s)). However the object file (.o) is created from that ppu file and eventually gets included in your executable by the linker.
This tagline is powered by AI

PeterHu

  • New Member
  • *
  • Posts: 20
Re: Light weighted IDE for Freepascal
« Reply #18 on: August 06, 2024, 01:07:13 pm »

Quote
One more question,does it add lconvEncoding.o or lconvEncoding.ppu?
Add to what exactly ?

The -Fu options defines a path to a single or multiple units (.ppu file(s)). However the object file (.o) is created from that ppu file and eventually gets included in your executable by the linker.

I got it.It looks for .ppu,finally links with object file(*.o).

Appreciated.

PeterHu

  • New Member
  • *
  • Posts: 20
Re: Light weighted IDE for Freepascal
« Reply #19 on: August 13, 2024, 02:39:47 am »
Seems some problems with github:
>>>Failed to resolve 'raw.githubusercontent.com'

Please download Runner (and lexer, and build-system) by hands from:
https://sourceforge.net/projects/cudatext/files/addons/
then open all new 3 .zip files from CudaText via 'File / Open'. It will install zip files.
Then restart Cud.


I am sorry for asking such a silly question:how to configure a certain language like pascal?I tried but have no clue to make it work.

Code: Text  [Select][+][-]
  1. FileNotFoundError:[WinError 2] the system failed to find the specified file.
  2.  

AlexTP

  • Hero Member
  • *****
  • Posts: 2465
    • UVviewsoft
Re: Light weighted IDE for Freepascal
« Reply #20 on: August 13, 2024, 10:12:28 am »
@PeterHu
You installed Runner plugin in CudaText and it cannot run the tool, shows FileNotFoundError?
You can configure the tool it uses.
It is file here:
(cudatext)/data/buildsystems/Free Pascal.sublime-build.

Content:
Code: Javascript  [Select][+][-]
  1. {
  2.   "file_patterns": ["*.pp", "*.pas", "*.lpr"],
  3.   "file_regex": "(.+?)\\((\\d+),(\\d+)\\)\\s(.+)$",
  4.   "working_dir": "$file_path",
  5.   "name": "Compile",
  6.   "cmd": ["/home/user/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.sh", "$file_name"],
  7.   "variants": [
  8.     {
  9.       "name": "Run",
  10.       "cmd": ["./$file_base_name"]
  11.     }
  12.   ]
  13. }
  14.  

Note: it is JSON file, so if you write backslash then escape it: \\.
« Last Edit: August 13, 2024, 10:14:50 am by AlexTP »

PeterHu

  • New Member
  • *
  • Posts: 20
Re: Light weighted IDE for Freepascal
« Reply #21 on: August 14, 2024, 02:14:58 am »
@PeterHu
You installed Runner plugin in CudaText and it cannot run the tool, shows FileNotFoundError?
You can configure the tool it uses.
It is file here:
(cudatext)/data/buildsystems/Free Pascal.sublime-build.

Content:
Code: Javascript  [Select][+][-]
  1. {
  2.   "file_patterns": ["*.pp", "*.pas", "*.lpr"],
  3.   "file_regex": "(.+?)\\((\\d+),(\\d+)\\)\\s(.+)$",
  4.   "working_dir": "$file_path",
  5.   "name": "Compile",
  6.   "cmd": ["/home/user/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.sh", "$file_name"],
  7.   "variants": [
  8.     {
  9.       "name": "Run",
  10.       "cmd": ["./$file_base_name"]
  11.     }
  12.   ]
  13. }
  14.  

Note: it is JSON file, so if you write backslash then escape it: \\.

Thank you very much.

 

TinyPortal © 2005-2018