Lazarus

Programming => LCL => Topic started by: Ever on March 05, 2019, 01:32:39 am

Title: Help with installation of pas2js
Post by: Ever on March 05, 2019, 01:32:39 am
Greetings to all

  I need to please explain to me how I correctly install pas2js in lazarus 2.0.0 for windows. I have already downloaded the Snapshots version but I can not get it to work. When installing lazarus in the components folder, there exists the pas2js folder, but I understand that what exists there alone is not enough. What else should I do to make it work? I have read the information of lazarus pas2js integration, but still I can not make it work. If someone has done it, you can explain the installation procedure step by step.

Thank you in advance for the support.

Ever Delgado
Title: Re: Help with installation of pas2js
Post by: JuhaManninen on March 05, 2019, 07:01:02 am
Here are some instructions:
 http://wiki.freepascal.org/pas2js#How_to_use_pas2js
Title: Re: Help with installation of pas2js
Post by: Ever on March 06, 2019, 05:00:33 pm
Someone who has already installed it can not do a step-by-step explanation of the correct way to operate it ?. Not everyone has extensive knowledge in the field. As much as they refer to pages and other links, none clearly explains the correct way of installation.
Thank you
Title: Re: Help with installation of pas2js
Post by: m.abudrais on March 06, 2019, 07:23:53 pm
I   followed the instruction here http://wiki.freepascal.org/lazarus_pas2js_integration (http://wiki.freepascal.org/lazarus_pas2js_integration)
1- Install the package pas2jsdsgn.
2-Then set the path of pas2js.
3- create a new project Choose web browser application.
4- build the application and you get  html file,that is your Application.
 you should give more details  of  your problem, what did you do?
Title: Re: Help with installation of pas2js
Post by: af0815 on March 06, 2019, 08:13:36 pm
When i do this
I   followed the instruction here http://wiki.freepascal.org/lazarus_pas2js_integration (http://wiki.freepascal.org/lazarus_pas2js_integration)
1- Install the package pas2jsdsgn.
2-Then set the path of pas2js.
3- create a new project Choose web browser application.
4- build the application and you get  html file,that is your Application.
 you should give more details  of  your problem, what did you do?

When i do this, i get
Quote
Pas2JS Compiler version 1.1.1 [2019/02/10] for Win32 i386
Info: (132) Message encoding is utf-8
Copyright (c) 2018 Free Pascal team.
Info: (126) Parsing D:\data\Versuche\js\project1.lpr ...
D:\data\Versuche\js\project1.lpr(5,5) Error: (3073) can't find unit "System"
Fatal: (118) Compilation aborted

So the first question is, where should the snapshot or svn checkout placed. Because i have the pas2js.exe found in my fpc bin path.
Title: Re: Help with installation of pas2js
Post by: m.abudrais on March 06, 2019, 08:51:21 pm
i have pas2js.exe  in separate path,(download folder!)it has no relation to fpc path.
i use version pas2js-windows-1.0.4 .
extract the snapshot in separate folder ,if the problem still exist then check pas2js.cfg file.
http://wiki.freepascal.org/pas2js.cfg (http://wiki.freepascal.org/pas2js.cfg)
Title: Re: Help with installation of pas2js
Post by: af0815 on March 06, 2019, 10:33:18 pm
Now i have the pas2js.exe twice. One time in the bin dir of fpc and in thze bin dir of the transpiler..

I use now the svn version and have recompiled wit clean all. This will also produce a valid pas2js.cfg file. With the path corrected for pas2js.exe in  the options of lazarus it will compile. And 'Hello world' is ok.


Now i try to open a demo (demortti) of the transpiler (in the svn), add the needed package to lazarus and want to compile ->   
Quote
Panic: internal error: cannot find executable "pas2js"

It looks all demos in demo/rtl are not to compile. Always the executable is not found.


Title: Re: Help with installation of pas2js
Post by: Ever on March 07, 2019, 03:26:40 am
even though I install the pas2jsdsgn package, it does not appear in the components palette.
Title: Re: Help with installation of pas2js
Post by: af0815 on March 07, 2019, 06:32:52 am
It installs in Options of Lazarus and add a new projecttypes. So nothing is shown in the componentpalette, pas2js is not a component it is an extension of Lazarus itself.
Title: Re: Help with installation of pas2js
Post by: m.abudrais on March 07, 2019, 01:55:39 pm
for me some demos work, and some didn't.
for demos which give
 
Quote
Panic: internal error: cannot find executable "pas2js"

i fixed that error by opening the .lpi file and replace $MakeExe(pas2js)
by
$(pas2js)
some demo like(fpreport) depends on server application which need fpc 3.2 to compile.
if compile succeed but you get empty page  in webbrowser you can fix that by modify js file name in html file.
Title: Re: Help with installation of pas2js
Post by: heejit on March 07, 2019, 04:18:37 pm
I am having following issue:
when running demo : pas2js/demo/rtl/demostringlist.lpi

Project: Executing command before: Exit code 1, Errors: 1, Warnings: 2
sysutils.pas(1991,37) Warning: Bitwise operation is 32-bit
sysutils.pas(3960,20) Warning: Bitwise operation is 32-bit
Fatal: custom JS file not found: "rtl.js"
Title: Re: Help with installation of pas2js
Post by: heejit on March 08, 2019, 05:06:53 pm
I found the issue:
rtl.js is not exist instead pas2js_rtl.js
but in lazarus project-option -> custome-option still shows rtl.js

replace with following I am able to compile
-Jeutf-8 -Jipas2js_rtl.js -Jc -Jminclude
Title: Re: Help with installation of pas2js
Post by: heejit on March 08, 2019, 05:23:59 pm
My Installation procedure:

1. Download pas2js create a new directory and extract zip into

2. Update pas2js path in Lazarus Option

3. change rtl.js file to pas2js_rtl.js in Project Option -> Custom Option

4. I don't have any pas2js in main fpc installation directory and fpc and lazarus installed through fpcupdeluex

Title: Re: Help with installation of pas2js
Post by: kotakomputer on November 17, 2019, 06:04:26 pm
I face similiar issue. the installation procedure not written very well: no step by step using numbering order, no detail picture and no real sample.
So, based on this forum answer, I try to complete the Wiki at:
HTH
Title: Re: Help with installation of pas2js
Post by: XakeR on September 29, 2020, 06:30:11 pm
When I try to run one of the demos, I get:

[Window Title]
Invalid debugger

[Content]
The Debugger Is "$(LazarusDir)\mingw\$(TargetCPU)-$(TargetOS)\bin\gdb.exe"
does not exist or is not an executable file.

Check Tools -> Options -> Debugger

[QA]

And when I added a form to a new project and then deleted it:
Fatal: parameter -gl: unknown parameter "-gl". Use -h for help.
TinyPortal © 2005-2018