Page 1 of 1

missing locale_charset on Mac

Posted: Fri May 15, 2020 8:45 pm
by sbloch
I just tried to build the latest download of FreeCiv on my Mac (OS 10.15.4), and everything went smoothly except, during "make",
Undefined symbols for architecture x86_64:
"_locale_charset", referenced from:
_init_character_encodings in libfreeciv.a(fciconv.o)
ld: symbol(s) not found for architecture x86_64
I tried ./configure | grep charset to see what configure thought about this, and it said
checking for libcharset... yes
configure: WARNING: Test to link against readline library failed.
Configuring server without readline support.
I don't know of any reason I would need readline in FreeCiv, so that part seems harmless, but it might indicate an underlying problem.

A Spotlight search turns up /opt/local/share/gettext/intl/localcharset.c, which defines a locale_charset() function; any reason configure and/or make couldn't find it?

Re: missing locale_charset on Mac

Posted: Fri May 15, 2020 9:47 pm
by cazfi
sbloch wrote:
Undefined symbols for architecture x86_64:
"_locale_charset", referenced from:
_init_character_encodings in libfreeciv.a(fciconv.o)
ld: symbol(s) not found for architecture x86_64
...

A Spotlight search turns up /opt/local/share/gettext/intl/localcharset.c, which defines a locale_charset() function; any reason configure and/or make couldn't find it?
That's a header file used during compile. The error you're getting is from linking step. Presumably it's not linking against some library that provides _locale_charset, OR the function provided by the library is really locale_charset but something (a macro?) is causing it to wrongly look for _locale_charset (with the beginning underscore).

EDIT: The file you list is a .c file, not a .h header, so forget my first two sentences.

Re: missing locale_charset on Mac

Posted: Sat May 16, 2020 11:16 am
by sbloch
I'm not sure how meaningful the distinction between locale_charset() and _locale_charset() is: I was assuming that the one with the underscore is some kind of compiler-generated internal version of the one without the underscore.

Re: missing locale_charset on Mac

Posted: Sun May 17, 2020 2:53 am
by sbloch
I got it to compile and run by commenting out the section of "configure" that checks for and sets HAVE_CHARSETLIB. Now HAVE_CHARSETLIB is always undefined, so it doesn't try to link in that function. But I'm sure there's a better way....