[metapost] mpost interactive prompt

Nicola nvitacolonna at gmail.com
Fri Nov 25 10:36:20 CET 2016

On 25/11/2016 09:35, luigi scarso wrote:
> On Fri, Nov 25, 2016 at 9:15 AM, Nicola <nvitacolonna at gmail.com> wrote:
>> On 23/11/2016 15:00, Nicola wrote:
>>> Hello,
>>> for some time I have been wondering whether it would be
>>> possible to improve mpost's command line interface by adding
>>> readline functionality.
>> I've got a reply off list suggesting to use mplib. That sounds
>> good, but I have some problems getting mplib source code, because
>> I cannot find the header files in TeX Live or ConTeXt Beta.
>> The only place where I have found mplib.h is in
>> trunk/branches/pweb/src/texk/web2c/mpdir
>> from
>> svn checkout https://foundry.supelec.fr/svn/metapost trunk
>> However, compiling a program results in 'mpd.h' not found. This
>> may depend on the fact that the checkout eventually times out,
>> leaving me with a partial download (I've tried a couple of times).
>> Is there a smaller download?
> The current trunk builds
> build/texk/web2c/libmplib.a
> and youu can find all the files into  build/texk/web2c
> mplib.h is "tangled" in mp.w, see  around line 90.

Ok, I've got this far (main.c from mplibapi.pdf):

gcc-6  -L./1.9991/build/texk/web2c -L./1.9991/build/libs/pixman -lgmp
\ -lmplib -lcairo -lpng -lmpfr -lmputil -lz -lpixman -I./1.9991/buil
\ /texk/web2c/ main.c

Undefined symbols for architecture x86_64:
   "_xstrdup", referenced from:
       _fm_scan_line in libmplib.a(libmplib_a-psout.o)
       _mp_png_save_to_file in libmplib.a(libmplib_a-pngout.o)
       _mp_png_gr_ship_out in libmplib.a(libmplib_a-pngout.o)
      (maybe you meant: _mp_xstrdup)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

What linking options am I missing?


More information about the metapost mailing list