From: Kenny McCormack on
<Looking for source code for libterminfo or libtermcap>

The actual problem: I am building VIM in an environment where a lot of
the usual libraries aren't present. The build (link) fails, with
message: undefined reference to term_set_winsize

I have googled around and downloaded a lot of stuff, but have not been
able to find this routine. I have found source code for ncurses (5.7)
and have compiled it, but this routine is not found. I have googled
some more and found that (I think) this routine is actually in a package
called ncurses-dev - but I cannot find source for that. I downloaded a
compiled package for my platform (arm), which contains a libncurses.a
and a libtermcap.a (the later is, in fact, a symlink to the former), but
no libterminfo.a (which is where I *think* this routine is to be found.

But I don't really trust binary package, since you can't grep to find
what you need (Yes, I've run "nm" on the above named library files, and
did not find "term_set_winsize", so I'm pretty sure it is not there).

So, again, where to find source code that will allow me to build a
library that contains term_set_winsize. I have also googled that
("term_set_winsize"), but the results were not useful.

--
> No, I haven't, that's why I'm asking questions. If you won't help me,
> why don't you just go find your lost manhood elsewhere.

CLC in a nutshell.

From: Sam on
Kenny McCormack writes:

> <Looking for source code for libterminfo or libtermcap>
>
> The actual problem: I am building VIM in an environment where a lot of
> the usual libraries aren't present. The build (link) fails, with
> message: undefined reference to term_set_winsize
>
> I have googled around and downloaded a lot of stuff, but have not been
> able to find this routine. I have found source code for ncurses (5.7)
> and have compiled it, but this routine is not found. I have googled
> some more and found that (I think) this routine is actually in a package
> called ncurses-dev - but I cannot find source for that.

This is likely a naming convention for your particular distribution. It's a
common convention: put all stuff necessary to support runtime use in
<package>, and development files in <package>-dev or <package-devel>.

> I downloaded a
> compiled package for my platform (arm), which contains a libncurses.a
> and a libtermcap.a (the later is, in fact, a symlink to the former), but
> no libterminfo.a (which is where I *think* this routine is to be found.

Now, go back to the same place where you downloaded "the compiled package",
and download "the compiled package-dev".

However you seem to have already downloaded the "dev" package, because *.a
files are typically packaged into the development package.

And, yes, I see no term_set_winsize function defined in the ncurses library.

From browsing Google, it looks like your problem is that after installing
libncurses, you must restart building VIM from scratch, from running its
configure script (and maybe even unpacking vim's tarball into an empty
directory), instead of merely rerunning 'make'.

If you still get this error, it means that vim's configure script is not
finding your libncurses library, for some reason.

From: Kenny McCormack on
In article <cone.1274825619.733238.25565.500(a)commodore.email-scan.com>,
Sam <sam(a)email-scan.com> wrote:
....
>Now, go back to the same place where you downloaded "the compiled package",
>and download "the compiled package-dev".
>
>However you seem to have already downloaded the "dev" package, because *.a
>files are typically packaged into the development package.
>
>And, yes, I see no term_set_winsize function defined in the ncurses library.
>
>From browsing Google, it looks like your problem is that after installing
>libncurses, you must restart building VIM from scratch, from running its
>configure script (and maybe even unpacking vim's tarball into an empty
>directory), instead of merely rerunning 'make'.
>
>If you still get this error, it means that vim's configure script is not
>finding your libncurses library, for some reason.

Well, I got it to build. And yes, as you indicate, there is a lot of
instances of this problem in googling. Googling for "term_set_winsize"
shows many different threads of people who have hit this problem. One
in particular gave me the idea for the fix - someone else had noticed
that the function is defined in term.c (see next).

It turns out that term.c (in the VIM distribution) contains a function
definition for "term_set_winsize", but it is wrapped in a #ifdef/#endif
that (for reasons I *didn't* research any further) effectively comments
it out in my setup. All I did was to edit term.c, and remove the
#ifdef/#endif around this (and one other) function, and then "make"
worked just fine. And it didn't require any of: ncurses, termcap, or
terminfo. Nor did I have to do any resetting/recompiling (other than
term.c, of course) or re-extracting the tarball.

So, on to the next... The resulting vim executable works fine (no GUI,
but that's fine) - except that when I run it, it says "vt100 is not
found" (or something like that) and that I have to use one of the 4
default built-in terminal types (ansi, linux, iris-ansi, dumb - I think
those are the 4 choices) and that it is defaulting to ansi. After that,
VIM works fine (since vt100 and ansi are *almost* identical - I don't
know how they differ, but I'm sure somebody does). But the point is
that $TERMINFO/v/vt100 exists and is correct, so must be some dumb
reason why vim isn't finding it. Oh well. I worked around this by
setting TERM=ansi before running VIM (i.e., setting up a shell script to
do: TERM=ansi vim).

So, the only annoying thing is the slight delay on startup and the
consequent need to kludge up a shell script to set TERM=ansi. Any ideas
why this happens or how to fix it?

--
(This discussion group is about C, ...)

Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch [sic] revelations of the childhood
traumas of the participants...

From: Dave Gibson on
Kenny McCormack <gazelle(a)shell.xmission.com> wrote:
> <Looking for source code for libterminfo or libtermcap>

<http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/termcap/>

> The actual problem: I am building VIM in an environment where a lot of
> the usual libraries aren't present. The build (link) fails, with
> message: undefined reference to term_set_winsize
>
> I have googled around and downloaded a lot of stuff, but have not been
> able to find this routine.

It's in the vim source (in src/term.c) and will only be compiled if the
configure script can find tgetent().

> I have found source code for ncurses (5.7) and have compiled it,

It may be necessary to make distclean in the vim source tree after
installing the new ncurses library.
From: Kenny McCormack on
In article <qd1uc7xdr4.ln2(a)perseus.wenlock-data.co.uk>,
Dave Gibson <dave.gma+news002(a)googlemail.com.invalid> wrote:
>Kenny McCormack <gazelle(a)shell.xmission.com> wrote:
>> <Looking for source code for libterminfo or libtermcap>
>
> <http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/termcap/>
>
>> The actual problem: I am building VIM in an environment where a lot of
>> the usual libraries aren't present. The build (link) fails, with
>> message: undefined reference to term_set_winsize
>>
>> I have googled around and downloaded a lot of stuff, but have not been
>> able to find this routine.
>
>It's in the vim source (in src/term.c) and will only be compiled if the
>configure script can find tgetent().

I re-did the build after "installing" ncurses (scare quotes added - see
below), and this time it all went smoothly.

However, the experience has revealed two flaws in the automake/configure
process:
1) configure should fail if it can't find something it needs.
I.e., if configure succeeds (as it does here), then it should be
pretty darn close to certain that the compile/link/build will
succeed (absent something catastrophic like a hard disk crash).
2) I did not do the usual "make install" with ncurses. Rather, I
simply copied the libncurses.a file to /usr/lib. That was the
only way I could get it to work. The point is that I am doing
this compile as a non-root user. I should not have to go root
(or sudo, which is the same thing) to get a library into a
position where configure can find it. One of the fundamental
assumptions of Unix/GNU free software is that you can, if you
want to, compile and use stuff w/o being root on the machine (as
long as the admin hasn't de-permitted the C compiler...)

Note on 2) above:
I tried the --libdir=DIR option on the configure command, to get
it to look there for the library - that didn't work. I also
tried doing: LDFLAGS=-LDIR ./configure; that didn't work either.
Looking at the configure script, I think that I could hack the
place where they set LDFLAGS, but I didn't try that.

--
> No, I haven't, that's why I'm asking questions. If you won't help me,
> why don't you just go find your lost manhood elsewhere.

CLC in a nutshell.