I have finally get pas2js to partially work from Lazarus 2.0.10 R 63526 Win32.
I have rebuilded Lazarus with pas2jsdsgn.lpk package. When ever I want to compile webbrowser app, I Am getting error. System unit not found. Error always appear on The line when uses some units are presented.
Where to put The necessary unit files?
I can put them to The root folder with The project, but this is not correct approach. Where to setup The unit location correctly please?
Mailing lists / pas2js / 2020-08
where to copy Pas2js units to get it work from lazarus
10 messages · 3 people · –
- MMgr. Janusz Chmiel 6
- MMattias Gaertner 3
- MMichael Van Canneyt 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Show quoted text 9 lines
One solution is to put a file pas2js.cfg into the folder where the pas2js.exe is located.
bin\x86_64-win64\pas2js.cfg
Here is the cfg example from the website:
# Write always a nice logo ;)
-l
# Display Warnings, Notes and Hints
-vwnh
# If you don't want so much verbosity use
#-vw
-Fu$CfgDir/../../packages/*
-Fu$CfgDir/../../compiler/utils/pas2js/dist/
#IFDEF nodejs
-Jirtl.js
#ENDIF
# Put all generated JavaScript into one file
-Jc
# end.
Dear Mr Gaertner,
I have used pas2js.cfg file which is The part of The latest stable Pas2js from 2019. I have added it to The folder with pas2js.exe but I Am getting The same rrror.
Should I copy old units from 2019 to The folder with pas2js.exe and fpc.exe and other compiler modules?
I do not know, where is pas2js unit which is The part of The latest stable Lazarus. I AM very sorry that I Am intruding. But I Am so near of my dream using Lazarus with Pas2js.
Dear Janusz,
You answered to my address, instead of the mailing list.
What example lpi do you open?
Mattias
Begin forwarded message:
Date: Sun, 23 Aug 2020 19:36:29 +0200
From: "Mgr. Janusz Chmiel"
To: "'Mattias Gaertner'"
Subject: RE: [Pas2js] where to copy Pas2js units to get it work from lazarus
My attempt have been successfull. So now, I Am fightighting with one unsoft behaviour of Lazarus.
When I use save all menu function, all files are saved to The desired filder except compiled .js script, which resides in The temporary Windows folder, so it is necessary to manually move it to The my desired project output folder.
But.
Console writeln command produces accessible output. Really. I had to compile The app with included
uses
browserconsole, JS, Classes, SysUtils, Web;Now I will have to build Pas2js from trunk because mixing code of units from trun release with stable release of Pas2js is very probably not very good idea and I will very probably get many compilation bugs.
But I Am facing other issue.
When I open The sample project with lazarus, when I open .lpi project file, Lazarus refuses to display source file and build function in The run menu do not work, because Lazarus warns that there is no main source file presented.
I think, that next stable Lazarus release will contain The necessary modiffication to support Pas2js project so professionally like The traditional Lazarus projects including compilation and saving all files to The correct location.
I have tried several examples from demo sub folder from Trunk Pas2js. Every .lpi project file produces unusable project. I have built pas2js successfully from trunk so I will try it with The latest trunk release, since it contain professional webvidgets unit.
I have tried several examples from demo sub folder from Trunk Pas2js. Every .lpi project file produces unusable project.
What means "unusable project"? A compile error?
If yes, then please setup the pas2js.cfg as I suggested.
I have built pas2js successfully from trunk so I will try it with The latest trunk release, since it contain professional webvidgets unit.
Keep in mind that trunk needs a pas2js.cfg with
-Fu$CfgDir/../../packages/*
-Fu$CfgDir/../../compiler/utils/pas2js/dist/
The pas2js release uses:
-Fu$CfgDir/../packages/*
-Fu$CfgDir/../compiler/utils/pas2js/dist/
Mattias
Unusable project mean.
That when I open .lpi project from Windows Explorer, Lazarus ask Me, if I want to open The file as a project or as a XML file. I choose as A project. But after that, Lazarus do not load source file. And ctrl+F9 do not work. I AM getting error, source main file not found.
So it is impossible to simply use some of available demo examples. I would had to create project new project by using new project wizard. And I would had to manually add some files to it. But existing .lpi files can not be opened successfully.
May be, that trunk release of Lazarus solve it. But I can perfectly open standard Lazarus FPC compiler based projects.
I Am experiencing only issues with pas2js .lpi project files. I will try to open previously created .lpi files which have been created by Me by using new project wizard.
So. When I open .lpi files, which have been previously created by using new project wizard, webbrowser app, those .lpi files are working smoothly and perfectly. I will examine sample .lpi XMl data if it do not contain some wrong compiler path, which have refferred to other computer.
Unusable project mean. That when I open .lpi project from Windows Explorer, Lazarus ask…
Mgr. Janusz Chmiel wrote 9 lines
This is probably due to the fact that I have created some of the projects with Lazarus trunk, which, as far as I know, uses a different project file format than the released version.
Michael.
Thank you very much for yours advice.
I will uninstall stable Lazarus and I will get trunk Lazarus and I AM using trunk release of Pas2js. I will reinstall The necessary .lpk component for pas2js.
I will use
https://svn.freepascal.org/svn/lazarus/trunk lazarus
Then I will teach Pas2js and GUi app creation thanks to yours demos which I will modify by for example by translating buttons texts from English to Czech. I will learn The syntax thanks to those analysis and translations. MR Canneyt, you are very talented developer. And thank you again that you are releasing so complex and reliable compiler for free. Now is everything on every users patience, desire to learn and develop. Thank you again.
