How to compile Wesnoth on Mac OS X

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

Moderators: Forum Moderators, Developers

Locked
Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

Ok i manage to solve the probs i listed above, now i get a strange error..

i do have SDL_net.h installed and it is already added to the project , still i can't compile because of this error..
I checked in "Summary > Settings > Search Paths" and the right path is there.. What's the deal?

EDIT: also solved the prob with SDL_net.h, now another 2 errors:

Code: Select all

filesystem.cpp:274: error: `messages' undeclared (first use this function)  (Each undeclared identifier is reported only once for each function it appears in.)
filesystem.cpp:422: error: parse error before `/' token
I start to think that i'll never be able to compile it myself :)

User avatar
ivanovic
Lord of Translations
Posts: 1147
Joined: September 28th, 2004, 10:10 pm
Location: Germany

Post by ivanovic »

I do not use XCode at all to build it. I think it is often a huge mess to build a programm with a graphicl prog like XCode or Visual C++. I do prefer to simply build it using normal ./configure make precedure. The only reason for me to have XCode installed it to have the GCC. because that is needed for compiling. Normally the project files are outdated. So it is easier to use the commandline where more users can help you if you got a problem.

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

Ok i tried running ./configure from inside the 0.9.5 source folder.. I got the error about SDL devel libraries not found.. Of course i already installed them, and the the configure script says i should check their path.. At the moment they are installed in /Library/Frameworks i think this is not correct in fact scott said they should rather be in ~/Library...

Where do i exactly have to put those libraries? A "Framewroks" folder does not exist in my ~/Library folder and i am not sure if a simple drag and drop is enough.. Any help is appreciated (sorry i am quite noob in these things :oops: )

ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

For a successful commandline build, you need the version of SDL from fink, since this version correctly installs the sdl-config script. The version of SDL from libsdl.org was built (for some reason known only to the person who built it) without an sdl-config script, so trying to configure using it will fail.

If you have the SDL from fink installed, you need to tell configure where to look for it, Ivanovic provided the correct configure commandline a few posts back.
This quote is not attributable to Antoine de Saint-Exupéry.

scott
Posts: 5242
Joined: May 12th, 2004, 12:35 am
Location: Alexandria, VA

Post by scott »

Here is how to make fink recognize unstable packages:
http://fink.sourceforge.net/faq/usage-fink.php#unstable
Hope springs eternal.
Wesnoth acronym guide.

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

Ok i installed Fink and the SDL-libraries without problems.. Now when i run ./configure it says it cannot find Freetype2 libraries, but following the wiki guide i did installed it using fink.. I also downloaded and compiled the source from http://www.freetype.org/ but still the problem persists.
I even tried reinstalling it using fink but it says there are no packages to install.. What should i do? Thanks

scott
Posts: 5242
Joined: May 12th, 2004, 12:35 am
Location: Alexandria, VA

Post by scott »

I updated the wiki guide last night. First, activate unstable packages, which you must have done already to install SDL-net.
Then type

Code: Select all

fink list -i | more
You should see freetype 1 is installed.
Now type

Code: Select all

fink install freetype2 freetype2-dev
I do not know if you need to remove freetype 1, but I did with

Code: Select all

fink remove freetype freetype-dev
and it [compilation] worked.
Hope springs eternal.
Wesnoth acronym guide.

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

Thank you all! I finally managed to compile wesnoth and run it from command line! :D

It's really satisfying, i must admit it. 8)

Thanks again for your help!


EDIT: I've just checked the wesnoth folder and it's about 220 Mb, is that normal? I was thinking about releasing my version for people (like me :wink: ) who don't want to wait for sith's version and want to launch it from terminal, but i don't think i can find a place to upload such a big file..


EDIT2: Now i have zipped the file but it's still 66 Mb.. :? :roll:

ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

If compiling using the configure/make process on the commandline, you need to run 'make install' as a final step to get everything into the right location. The folder in which you compile will have all the source and object files, which aren't needed to run the game. A .dmg containing all the game files, statically built, with an installer, is around 35-40MB.
This quote is not attributable to Antoine de Saint-Exupéry.

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

You are right thanks ott. Actually i have a wesnoth app which is 63,2 Mb and it contains all the files needed for the game to run because when i simply type ./wesnoth from inside the folder (which contains only the wesnoth app), the game starts and there are no problems..
I compressed it in a .dmg file and the result is around 13Mb :D

scott
Posts: 5242
Joined: May 12th, 2004, 12:35 am
Location: Alexandria, VA

Post by scott »

I had the same question about the wesnoth exe. Mine was also 63 MB but it seemed to need the data files in the share folder in order to function. I'll play with it some more and try to come up with something more specific to tell you.
Hope springs eternal.
Wesnoth acronym guide.

ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

Hellrider wrote:i have a wesnoth app which is 63,2 Mb
You should probably strip the executable file then.
This quote is not attributable to Antoine de Saint-Exupéry.

Hellrider
Posts: 81
Joined: July 22nd, 2005, 9:57 am

Post by Hellrider »

ott wrote:
Hellrider wrote:i have a wesnoth app which is 63,2 Mb
You should probably strip the executable file then.

Well honestly i am quite happy as it is, because now i have learned how to compile wesnoth myself without waiting for a mac binary.. Anyway i will try to understand better the entire process (and maybe strip the executable file :wink: ), although it is quite fast as it is now (even faster than usual mac binary..)
Again thanks for your help :D

MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

My attempt to compile 0.9.5 in xcode gave me the following error:

Code: Select all

(related warning)wesnoth-0.9.5:0: warning prebinding disabled because of undefined symbols
(error)wesnoth-0.9.5:0: Undefined symbols:
. What gives? I clicked Reveal in Finder, and it highlighted the folder I was compiling in! It seems like it's trying to compile the folder itself.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom

scott
Posts: 5242
Joined: May 12th, 2004, 12:35 am
Location: Alexandria, VA

Post by scott »

In the detailed build results window, there is a knob at the bottom you have to drag up to show a split window. That lower window will show you which file is missing from the project file. Locate that file in the finder and drag it to the xcode project (wesnoth src). Hit build again and it should work. You might have to repeat for multiple missing files.
Hope springs eternal.
Wesnoth acronym guide.

Locked