Help compiling on a mac

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
semelis
Posts: 9
Joined: October 30th, 2005, 8:52 pm
Location: Barcelona

Help compiling on a mac

Post by semelis »

Hello all!

I'm quite new to Mac and wanted to compile Wesnoth here, after a bit of library hunting I managed to get an only warning from ./configure about the libzipios++, so I tried to make it, but I get linking errors.

If I try to use the gettext installed by fink at /sw (which seems a kind of mix of 2 versions: 0.14.5 0.10.20) I get:
/usr/bin/ld: warning multiple definitions of symbol _locale_charset
/sw/lib/libintl.dylib(localcharset.lo) definition of _locale_charset
/sw/lib/libiconv.dylib(localcharset.o) definition of _locale_charset
/usr/bin/ld: Undefined symbols:
_libintl_gettext
_libintl_bind_textdomain_codeset
_libintl_dgettext
_libintl_ngettext
_libintl_bindtextdomain
If I try to use the one installed bye darwin ports at /opt/local I get
/usr/bin/ld: Undefined symbols:
_libintl_gettext
_libintl_bind_textdomain_codeset
_libintl_bindtextdomain
_libintl_textdomain
_libintl_dgettext
_libintl_ngettext
Here there's no duplicated symbol warning and order is different. ?

Well, before trying to get the gettex sources and compile them to have a third installation at /usr/local/ I've decided to ask what must I do besides setting the --with-libintl-prefix that seems enough for the configure but not enough to actually link ...
Joan
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

You will have to use fink to install libgettext3-dev rather than libgettext 0.10
It should automatically uninstall 0.10 when you attempt to install the newer version.

This page might be right up your alley:
http://www.wesnoth.org/wiki/CompilingWesnothOnMacOSX
Hope springs eternal.
Wesnoth acronym guide.
lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

gettext is a pain.
different versions may not be compatible each other.
Just keep one of them.
It may require to you to recompile tons of stuff who used one of the versions.

If you have Xcode 2.1 (on Tiger), you may try to compile with my buildkit at http://lwa.retiaire.org/wesnoth/MacComp ... wa.tar.bz2
It use a static and redicaced gettext version, so it shall not conflict with yours.
semelis
Posts: 9
Joined: October 30th, 2005, 8:52 pm
Location: Barcelona

Post by semelis »

Thanks for the replays, I'll try both :)
In fact I've already downloaded XCode 2.2 (I had 2.0) to try the xcode approach, but as the instructions said that the unix mantra
./configure ; make ; sudo make install
had to work anyway for XCode to work too ...
Joan
lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

configure and xcode have not the same requirements.

Xcode build has his own version of gettext and use SDL framework family.
configure need gettext and SDL installed as dynamic libraries.
semelis
Posts: 9
Joined: October 30th, 2005, 8:52 pm
Location: Barcelona

Post by semelis »

Maybe I'm mixing your distribution instructions and the ones by Sithrandel ?
I'm reading too much too fast lately and my head is as scrambled as my libraries ...

OK, getting same version for all the gettex pieces with fink makes the unix mantra work with --with-libintl-prefix=/sw , although still there's the duplicated definitions warning.

Now to compile it under XCode to get a 3rd version and keep eating away my disk space :)
Joan
semelis
Posts: 9
Joined: October 30th, 2005, 8:52 pm
Location: Barcelona

Post by semelis »

Fantastic !
After getting a couple of SDL frameworks that I still lacked it works out of the box :)

Next step: try to understand the AI and *maybe* try to improve it.

I will not bother you more unless I get some results.
But probably I'll spent more time playing myself than coding :P
Joan
lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

semelis wrote:Maybe I'm mixing your distribution instructions and the ones by Sithrandel ?
I'm reading too much too fast lately and my head is as scrambled as my libraries ...
My build instructions are more easy than Sithrandel's (at least, when I first compiled with Xcode) because the files are directly on the right place and gettext really compile without manual hack.

If you mix both, you will eventualy have some trouble.
semelis wrote:OK, getting same version for all the gettex pieces with fink makes the unix mantra work with --with-libintl-prefix=/sw , although still there's the duplicated definitions warning.
I don't known the reason of the double symbol warning but I never got trouble for this with any software. You can compile without iconv, because wesnoth don't need it on Mac OS X (gettext is compiled without on my build)
semelis
Posts: 9
Joined: October 30th, 2005, 8:52 pm
Location: Barcelona

Post by semelis »

Then the HOWTO.txt in MacCompileStuff must be updated, as it states:
Before being able to compile the Project, you must
be able to compile Wesnoth with the standart Unix way
that is, run
sh configure && make
from the Wesnoth distribution.
and later
You need gettext installed from sources (avaiable at FTP.GNU.ORG), the
Project expect it to be installed in the default path (/usr/local)
Joan
lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

Thanks for report. I removed this old instuctions.
jacobolus
Posts: 19
Joined: February 27th, 2006, 9:24 pm

Post by jacobolus »

When building with XCode, I get the following error:

Linking /Users/jrus/wesnoth/MacCompileStuff/build/BattleForWesnoth.build/Wesnoth/Battle for Wesnoth.build/Objects-normal/ppc/Battle for Wesnoth

can't locate framework for: -framework SDL_ttf


I have this framework installed in /Library/Frameworks/. I am using the code from SVN, and the "Mac Compile Stuff" folder from the 1.1.2 distribution.
lwa
Inactive Developer
Posts: 271
Joined: June 11th, 2005, 8:19 am
Location: Paris, France

Post by lwa »

If you're using 10.4 universal binary SDK, the frameworks have to be located in /Developers/SDK/10.4u/Library/Framwork too (use symlinks).

You can remove the universal binary build if you don't need or don't have the compatible frameworks.
Post Reply