Menu

#2813 printf missing in (standalone) NASAL interpreter??

2020.4
Invalid
nobody
None
Low
2023-06-26
2023-06-25
waldo kitty
No

using the standalone nasal binary in FG's bin directory, printf seems to be missing... i've not tried this from within FG using the nasal console...

using the attached nas file, i get the following output:

In hexadecimal, 100000 = 186A0
Runtime error: undefined symbol: printf
  at /home/myuser/fg/next/install/flightgear/fgdata/Nasal/nasaltest1.nas, line 4
  called from: /home/myuser/fg/next/install/flightgear/fgdata/Nasal/nasaltest1.nas, line 1


yes, there's a defect in the example line given but i corrected it in my attached test file...

1 Attachments

Discussion

  • waldo kitty

    waldo kitty - 2023-06-25

    i don't know what happened to the link to the wiki page that i put in the original report above :(
    here it is again but raw this time instead of trying to use the link function...
    https://wiki.flightgear.org/Nasal_library#printf.28.29

     
  • James Turner

    James Turner - 2023-06-26

    Just checked, the printf function just calls sprintf, but that alias is defined by FGData/Nasal/globals.nas, which of course is not loaded by standalpone Nasal.

    So, in standalone, use sprintf, is the answer. (or just everywhere, I guess, since it always works)

     
  • James Turner

    James Turner - 2023-06-26
    • status: New --> Invalid
     

Log in to post a comment.