Talk:How to compile

From The Cataclysm: Dark Days Ahead Wiki
Jump to navigation Jump to search

Sep's notes

may 5th, 2012. geared to the new, aka 'written for my neighbors little brother':

a couple of notes on compiling on and for windows since i've actually done all three. some of this should probably be on the main page. if someone reads this and is inspired to move code::blocks to the top of the list on the main page, i'd cheer as i don't actually have the bandwidth to anything much at the time. .. also if you want to revert this, be so kind as to put these notes into a comment for now, i'll make an account where i can post this within 2 weeks, but i think this might just be useful for many:

cygwin

Is currently broken no matter how one wants to spin it. i'm in the hospital right now and want to commit fixes to the zillion warnings the compiler throws up at some point later, but no matter, the build takes more memory than i have and it does not complete once it starts to swap.

cygwin: is useful for how easy it makes it to 'git stash' your own changes and/or to just update from the repo with a simple 'git pull'. just alter your startup script to 'cd' and do both of these for you and you can update your source tree with a single click. beyond that its useful just because of how complete it is for running linux things like rsync/wget etc in windows. but for more bells and whistles with the source, when you don't yet have your git-clue-card filled out, just install the windows github-client and leave it be at that.

mingw

Eventually you will settle on the mingw compiler. do save your self some time and head-scratching and install it via the code::blocks method instead so that you have an IDE through which to familiarize your self with the code too ...

mingw: you can use mingw standalone and install it next to cygwin if you just want to get and compile your code. for that, use cygwin to 'git pull' and mingw to 'make -f makefile.windows' and with a little bit of poking around you can so update your source tree and make an up to date exe in just two clicks.

code::blocks

code::blocks is an anagram for awesome. if you are not allergic to having an ide, that's to say, you're open to learning something new and want to learn to see what happens on crashes or what all this 'code' stuff is all about, get this -- and the github windows client - and notepad++ while you're at it -- and get the most fun for your efforts.

code::blocks: and the github windows client should be thought of as a meta-game. if you approach them this way you will find it easier to ignore the stuff that detracts you from the win; a playable cataclysm.exe that you can brutalize at will!

until save-file compatibility has been proven and 05++ starts to rule the gaming world, here's a job for you: "find 'optimist' in the sources and make it so that it give you 60 or 80 plus points" .. this will 'pay you back' for the time you might have lost by starting a new game.

IRC copy-paste

Here's the IRC transcript from which I based that note. Someone wants to clean it up, please do. KA101 (talk) 17:58, 20 November 2013 (PST)


Callidus2	what packages do I need for sdl?
Callidus2	is there a list?
kevingranade	to compile?
Callidus2	yes
Callidus2	i have a suspicion the wiki is a bit outdated
kevingranade	sdl, sdl-ttf, sdl-image, and -dev versions of each
kevingranade	and maybe one more...
Callidus2	the wiki lists sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev:i386
Callidus2	im guessing that is out of date then?
kevingranade	no that's it, also zlib and freetype, but you probably have those
Callidus2	ok.
kevingranade	yea, you need libsdl-image too
Callidus2	thanks.
Callidus2	ok
Callidus2	that may be why it was failing earlier today
Callidus2	dev of that one too?
kevingranade	yes
KA101	OK, where are the effects such as "ME_STUNNED" defined? doesn't seem to be a clear culprit from FindInFiles
Callidus2	is just the dev's enough?
kevingranade	yea, your package manager should pull in the normal versions as necessary
kevingranade	oh, and optionally grab lua51.-dev
kevingranade	5.1
Callidus2	and im curious as to whether the libsdly-ttf2.0-dev needs the :1386
kevingranade	generally no
Callidus2	hmm
Callidus2	unable to locate libsdl-image-dev
kevingranade	not sure what it's called, debian?
Callidus2	mint.
Callidus2	so debian based iirc
kevingranade	I have libsdl-image1.2
falconne	mint is ubuntu
kevingranade	but can I build sdl, might noit have tried on that system
kevingranade	lies
falconne	but yeah, debian based
kevingranade	it used to be, but they rebased on debian
falconne	Oh, when did they rebase?
Callidus2	slowly is getting accustomed to the terminal.
kevingranade	apt-cache search sdl | less
kevingranade	hah, don't listen to me, my debian system doesn't have the libraries installed either
Callidus2	lol.
Callidus2	oh great.
kevingranade	my main system is fedora
Callidus2	so libsdl-image1.2 is not enough?
kevingranade	probably need dev
Callidus2	ok then
Callidus2	how do I go about that?
Callidus2	wb vache
falconne	After they work it out from scratch someone should add a getdeps shell script
Callidus2	I would settle for up to date wiki pages : p
vache	my main hat is fedora
falconne	So the versions are controlled under source control
kevingranade	looks like you want libsdl-image1.2-dev

Ubuntu recent findings

Seems theres no SDL2 compile instructions on Linux/Ubuntu?

makefile and some files seemed to be looking in wrong places, throwing up dependency errors?


libsdl2-dev is now available, and associated - libsdl-ttf2.0-dev, libsdl2-image-dev. possible issue is catatiles.h in src

"#include "SDL2/SDL_ttf.h"

wheras sdl_ttf.h is found in SDL/SDL_ttf.h , this change ( removing the number 2) to catatiles.h and sdltiles.cpp got past initial errors.

These two lines in makefile also seemed wrong?

 else # not osx
   LDFLAGS += -lSDL2 -lSDL2_ttf

ld - cannot find lsdl2_ttf is error on compile.

however - again remove the 2 to;

 else # not osx
   LDFLAGS += -lSDL2 -lSDL_ttf

then everything compiled sucesfully.

Do not want to edit wiki instructions as I stumbled onto this fix with no knowledge of anything related, but it seems to be the case, can anyone reproduce?

Yes the Linux instructions are pretty much outdated and won't work for Ubuntu (or any distro for that matter). The most current and working instructions are in COMPILING.md (linked on this page). Besides linux, most of the other guides on this page are outdated; the Windows guide didn't work when I tried it, for example. I think this page has no further significance and should be deleted. And you should sign your edits on the talk page with two '-' followed by four tildes (the '~' sign).--Hexman (talk) 05:33, 14 September 2016 (UTC)

Outdated information

This is all pretty outdated, esp the windows guides. I suggest we scrap this all, and just point to the guide on github (The first comment on the page), and the toolbox part of the forums (http://smf.cataclysmdda.com/index.php?board=10.0) --Soyweiser (talk) 15:26, 4 July 2016 (UTC)