bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling ncurses-6.1 on OpenBSD


From: Thomas Dickey
Subject: Re: Compiling ncurses-6.1 on OpenBSD
Date: Sat, 27 Jul 2019 17:00:44 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Jul 16, 2019 at 11:56:13AM +0900, Robert Smith wrote:
> Thank you Gentlemen so much for looking at this. Our stack requires some of 
> the newer features of ncurses and we've been able to build pretty 
> successfully on OpenBSD until recently.
> 
> I found the following while I was searching for a solution.  I dismissed it
> because I didn't see g++ getting executed so I did not realize that these
> were c++ files.

ncurses's makefiles don't run g++ on "C" code or gcc on "C++" code
(though of course someone could set $CC and $CXX to confuse things)
 
> Does it help this situation?
> 
> The following text found here: 
> https://stackoverflow.com/questions/2543813/ld-reports-missing-symbols-but-symbols-seem-to-exist
> 
> Those symbols are unmangled C symbols.  As you have tagged this as C++, I
> assume you are compiling with C++.  If you do that you may need to wrap your
> libraries header files in an extern block in your code:

I didn't touch that particular question/answer.

The ncurses header files do have the extern "C" stuff (since 1995...)
So name-mangling isn't likely the problem you're running into.

Occasionally someone using C++ has problems with the macros (such as clear),
but that's not going to be changed).
 
> extern "C" {
> #include "library.h"
> }
> where library.h is the name of the library's header file(s), to prevent them 
> being mangled in the calling code.
> 
> 
> -Robert
> 
> 
> 
> > On Jul 13, 2019, at 9:58 AM, Thomas Dickey <address@hidden> wrote:
> > 
> > On Fri, Jul 12, 2019 at 09:45:05PM +0900, Robert Smith wrote:
> >> Hello all,
> >> 
> >> Has anyone successfully compiled ncurses-6.1 on OpenBSD 6.5?
> >> 
> >> I have tried almost every combination of configuration options available 
> >> and they always result in the linker not being able to link one of the 
> >> programs that get built in the test directory to libncurses shared library.
> >> 
> >> I've been working on this for a couple of days and have tried just about 
> >> every kind of configuration option combination imaginable.
> >> 
> >> All tests run using ncurses-6.1-20190706
> >> 
> > 
> > I can reproduce this failure :-)
> > 
> >> Get the following errors on different runs.
> > 
> > actually there's a half-dozen cases that I see - but they're all basically
> > the same problem.
> > 
> >> ld: error: undefined symbol: use_tioctl
> >> 
> >> ld: error: undefined symbol: init_extended_color
> >> 
> >> ld: error: undefined symbol: extended_color_content
> > 
> > yes - even when you turn on the rpath option, the BSD's notion of weak
> > linkage is too weak to actually pull in the dependent libraries without
> > some effort.  Since OpenBSD's curses library is ~11 years old, there
> > are a few new symbols...
> > 
> >> Others from memory include
> >> 
> >> Every single time the symbols exist in the library but they just do not 
> >> link properly
> > 
> > (I last built for OpenBSD 6.2 in February).
> > 
> > I installed the new OpenBSD this evening to take a look.
> > My usual script for development happens to work.
> > Looking at that, I see that I'm doing this, which is relevant:
> > 
> >     + adding "--enable-weak-symbols" and
> > 
> >     + setting the RPATH_LIST variable, e.g.,
> > 
> >             RPATH_LIST=../lib:$MY_DIR/lib \
> > 
> > That compiles/links (but I'll investigate more).
> > 
> > -- 
> > Thomas E. Dickey <address@hidden>
> > https://invisible-island.net
> > ftp://ftp.invisible-island.net
> 

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]