missing locale_charset on Mac

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
sbloch
Posts: 3
Joined: Fri May 15, 2020 8:29 pm

missing locale_charset on Mac

Postby sbloch » Fri May 15, 2020 8:45 pm

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?

cazfi
Elite
Posts: 1781
Joined: Tue Jan 29, 2013 6:54 pm

Re: missing locale_charset on Mac

Postby cazfi » Fri May 15, 2020 9:47 pm

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.

sbloch
Posts: 3
Joined: Fri May 15, 2020 8:29 pm

Re: missing locale_charset on Mac

Postby sbloch » Sat May 16, 2020 11:16 am

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.

sbloch
Posts: 3
Joined: Fri May 15, 2020 8:29 pm

Re: missing locale_charset on Mac

Postby sbloch » Sun May 17, 2020 2:53 am

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....