Forum > Pas2JS

[SOLVED] Not able to compile simple program using pas2js

(1/2) > >>

heejit:
Lazaurs : 2.1
fpc        : 3.3.1


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---file : b.pas program hello; begin  Writeln('Hello, world!');end. pas2js -vtb -Jc -Jirtl.js -Tbrowser b.pasInfo: Configfile search: /home/jiten/.pas2js.cfgInfo: Configfile search: /home/jiten/fpc-trunk/fpc/bin/x86_64-linux/pas2js.cfgInfo: Configfile search: /etc/pas2js.cfgInfo: output file: ""Info: Searching file: /home/jiten/System.pp... not foundInfo: Searching file: /home/jiten/System.pas... not foundInfo: Searching file: /home/jiten/System.p... not found/home/jiten/b.pas(3,6) Error: can't find unit "System"Fatal: Compilation abortedAn unhandled exception occurred at $00000000004A56A3:Exception:  $00000000004A56A3  $00000000004128DB 

jiutianfei:
My ~/.pas2js.cfg contains this line:


-Fu/home/jiutianfei/pas2js/packages/rtl


That directory looks like this:


browserconsole.pas   libjquery.pas   README.txt     sysutils.pas
classes.pas        math.pas        rtlconsts.pas  types.pas
contnrs.pas        nodejs.pas      rtti.pas       typinfo.pas
dateutils.pas        objpas.pas      strutils.pas   webgl.pas
hotreloadclient.pas  pas2js_rtl.lpk  system.js       web.pas
js.pas           pas2js_rtl.pas  system.pas     webrouter.pp

Thaddy:
Indeed, the issue is you did not include the library path. Note with pas2js I prefer to do it like the above or create a custom fpjsc.cfg for that

heejit:
I dont have directory like pas2js/package

I have installed fpc/lazarus trunk using fpcupdeluxe

do I need to install anything else again ?



heejit:
I have installed pas2js-rtl from fpcupdeluxe

Still same error

After installing pas2js-rtl new cfg file created now there is new error
after running following

pas2js @fpc-trunk/fpc/bin/pas2js.cfg -vtb -Jc -Tbrowser b.pas


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Fatal: bug: uncaught Exception: Fatal: Exception: Fatal: Compilation abortedAn unhandled exception occurred at $00000000004A56A3:Exception:   $00000000004A56A3  $00000000004A630B  $00000000004A3072  

Navigation

[0] Message Index

[#] Next page

Go to full version