Color your terminal's output

Jens Mueller jens.k.mueller at gmx.de
Sun Mar 10 12:00:06 PDT 2013


Axl wrote:
> On Sunday, 10 March 2013 at 14:38:15 UTC, Jens Mueller wrote:
> >Axl wrote:
> >>When I run:
> >>
> >>$ dmd -unittest -m64 /usr/lib/x86_64-linux-gnu/libncurses.a -run
> >>terminal.d
> >>
> >>I get the follwoing output:
> >>
> >>terminal.o: In function `_D8terminal12_staticCtor2FZv':
> >>terminal.d:(.text._D8terminal12_staticCtor2FZv+0x27): undefined
> >>reference to `setupterm'
> >>terminal.d:(.text._D8terminal12_staticCtor2FZv+0x81): undefined
> >>reference to `tigetstr'
> >>terminal.d:(.text._D8terminal12_staticCtor2FZv+0x12b): undefined
> >>reference to `tigetstr'
> >>terminal.d:(.text._D8terminal12_staticCtor2FZv+0x1cc): undefined
> >>reference to `tigetstr'
> >>terminal.d:(.text._D8terminal12_staticCtor2FZv+0x26d): undefined
> >>reference to `tigetstr'
> >>terminal.d:(.text._D8terminal12_staticCtor2FZv+0x30e): undefined
> >>reference to `tigetstr'
> >>terminal.o:terminal.d:(.text._D8terminal12_staticCtor2FZv+0x3af):
> >>more undefined references to `tigetstr' follow
> >>terminal.o: In function `_D8terminal8Terminal36__T13setCapabilityTE8terminal5ColorZ13setCapabilityMFxE8terminal10CapabilityxE8terminal5ColorZv':
> >>terminal.d:(.text._D8terminal8Terminal36__T13setCapabilityTE8terminal5ColorZ13setCapabilityMFxE8terminal10CapabilityxE8terminal5ColorZv+0xb2):
> >>undefined reference to `tparm'
> >>terminal.d:(.text._D8terminal8Terminal36__T13setCapabilityTE8terminal5ColorZ13setCapabilityMFxE8terminal10CapabilityxE8terminal5ColorZv+0xc2):
> >>undefined reference to `tputs'
> >>terminal.d:(.text._D8terminal8Terminal36__T13setCapabilityTE8terminal5ColorZ13setCapabilityMFxE8terminal10CapabilityxE8terminal5ColorZv+0x147):
> >>undefined reference to `tparm'
> >>terminal.d:(.text._D8terminal8Terminal36__T13setCapabilityTE8terminal5ColorZ13setCapabilityMFxE8terminal10CapabilityxE8terminal5ColorZv+0x157):
> >>undefined reference to `tputs'
> >>terminal.o: In function `_D8terminal8Terminal19__T13setCapabilityZ13setCapabilityMFxE8terminal10CapabilityZv':
> >>terminal.d:(.text._D8terminal8Terminal19__T13setCapabilityZ13setCapabilityMFxE8terminal10CapabilityZv+0xac):
> >>undefined reference to `tparm'
> >>terminal.d:(.text._D8terminal8Terminal19__T13setCapabilityZ13setCapabilityMFxE8terminal10CapabilityZv+0xbc):
> >>undefined reference to `tputs'
> >>terminal.d:(.text._D8terminal8Terminal19__T13setCapabilityZ13setCapabilityMFxE8terminal10CapabilityZv+0x13e):
> >>undefined reference to `tparm'
> >>terminal.d:(.text._D8terminal8Terminal19__T13setCapabilityZ13setCapabilityMFxE8terminal10CapabilityZv+0x14e):
> >>undefined reference to `tputs'
> >>collect2: ld returned 1 exit status
> >>--- errorlevel 1
> >>
> >>I know it is a linker error, but I cannot fix it. Any ideas?
> >
> >Have you tried linking against libtermcap/libtinfo?
> >
> >Jens
> 
> It works against both those libs.

You only need one of those. libtermcap just points to libtinfo, at least
on my system. You don't need ncurses. Glad it works.
BTW you can report problems at https://github.com/jkm/terminal/issues.

Jens


More information about the Digitalmars-d mailing list