bug-ncurses
[Top][All Lists]
Advanced

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

form not linking shared libs correctly


From: Brownridge, Tom
Subject: form not linking shared libs correctly
Date: Mon, 4 Mar 2019 17:52:48 +0000

Hi,

Building --with-shared using Cygwin & mingw, I ran into this error:

linking ../lib/libform6.dll
/bin/sh ../mk_shared_lib.sh ../lib/libform6.dll x86_64-w64-mingw32-gcc -O2 
--param max-inline-insns-single=1200 ../obj_s/fld_arg.o ../obj_s/fld_attr.o 
../obj_s/fld_current.o ../obj_s/fld_def.o ../obj_s/fld_dup.o 
../obj_s/fld_ftchoice.o ../obj_s/fld_ftlink.o ../obj_s/fld_info.o 
../obj_s/fld_just.o ../obj_s/fld_link.o ../obj_s/fld_max.o ../obj_s/fld_move.o 
../obj_s/fld_newftyp.o ../obj_s/fld_opts.o ../obj_s/fld_pad.o 
../obj_s/fld_page.o ../obj_s/fld_stat.o ../obj_s/fld_type.o ../obj_s/fld_user.o 
../obj_s/frm_cursor.o ../obj_s/frm_data.o ../obj_s/frm_def.o 
../obj_s/frm_driver.o ../obj_s/frm_hook.o ../obj_s/frm_opts.o 
../obj_s/frm_page.o ../obj_s/frm_post.o ../obj_s/frm_req_name.o 
../obj_s/frm_scale.o ../obj_s/frm_sub.o ../obj_s/frm_user.o ../obj_s/frm_win.o 
../obj_s/fty_alnum.o ../obj_s/fty_alpha.o ../obj_s/fty_enum.o 
../obj_s/fty_generic.o ../obj_s/fty_int.o ../obj_s/fty_ipv4.o 
../obj_s/fty_num.o ../obj_s/fty_regex.o -L../lib -lncurses
Linking shared library
** SHARED_LIB ../lib/libform6.dll
** IMPORT_LIB ../lib/libform.dll.a
../obj_s/fty_regex.o:fty_regex.c:(.text+0x54): undefined reference to `regcomp'
../obj_s/fty_regex.o:fty_regex.c:(.text+0xf5): undefined reference to `regfree'
../obj_s/fty_regex.o:fty_regex.c:(.text+0x151): undefined reference to `regexec'

I downloaded ncurses-6.1-20190302 and configured like this:

./configure \
        --host=x86_64-w64-mingw32 \
        --enable-term-driver \
        --enable-sp-funcs \
        --prefix=/usr/local/ncurses \
        --with-shared

The configure script appeared to find gnurx:

checking for regcomp... no
checking for regcomp in -lgnurx... yes
checking for regular-expression headers... regex.h

But seems it didn't get into the Makefile quite right, SHLIB_LIST is missing 
-lgnurx

---------begin snip form/Makefile------------
LINK            = $(LIBTOOL_LINK)
LDFLAGS         =   -lgnurx -lpsapi

SHLIB_DIRS      = -L../lib
SHLIB_LIST      = $(SHLIB_DIRS) -lncurses

RPATH_LIST      = ${libdir}
RESULTING_SYMS  =
VERSIONED_SYMS  =
MK_SHARED_LIB   = /bin/sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}

NCURSES_MAJOR   = 6
NCURSES_MINOR   = 1
REL_VERSION     = 6.1
ABI_VERSION     = 6

RANLIB          = x86_64-w64-mingw32-ranlib

LIBRARIES       =  ../lib/libform${ABI_VERSION}.dll ../lib/libform.a 
../lib/libform_g.a

LINT            =
LINT_OPTS       =
LINT_LIBS       = -lform -lncurses -lgnurx -lpsapi
---------end snip form/Makefile------------

This seemed to fix the issue, but to be honest, I'm naively hacking about:

--- Makefile.in.orig    2019-03-04 12:38:39.505508600 -0500
+++ Makefile.in 2019-03-04 12:39:30.995574100 -0500
@@ -107,7 +107,7 @@
 LDFLAGS                = @LDFLAGS@ @LD_MODEL@ @LIBS@

 SHLIB_DIRS     = -L../lib
-SHLIB_LIST     = $(SHLIB_DIRS) address@hidden@ @SHLIB_LIST@
+SHLIB_LIST     = $(SHLIB_DIRS) address@hidden@ @SHLIB_LIST@ @LIBS@

 RPATH_LIST     = @RPATH_LIST@
 RESULTING_SYMS = @RESULTING_SYMS@


I'm still working through some other self-inflicted issues... but this at least 
seems sane enough to publish.


Sincerely,

Tom Brownridge

________________________________

This message is intended only for the use of the individual or entity to which 
it is addressed. If the reader of this message is not the intended recipient, 
or the employee or agent responsible for delivering the message to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this message is strictly prohibited. If you have received this 
communication in error, please notify us immediately by replying to the sender 
of this E-mail by return E-mail or by telephone.



reply via email to

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