Skip to content

Installation and Running

Kingsley Hendrickse edited this page Mar 21, 2015 · 14 revisions

Installation & Running Instructions

## OSX (Yosemite)

git clone https://github.com/masterthought/dtanks.git
cd dtanks

Then point the path in the dub.json to the correct DSFML:

"lflags" : ["-L/Users/kings/development/projects/dtanks/DSFML/OSX/lib"],

Then install the OSX libs onto the Frameworks path by running:

dtanks/DSFML/OSX/install.sh

Then run dub:

dub

If there are missing dependencies you may have to install them via brew install e.g

brew install glew freetype libsndfile 

Linux (Ubuntu)

I tested these instructions with Ubuntu Linux 14.04 Desktop

git clone https://github.com/masterthought/dtanks.git
cd dtanks

Then point the path in the dub.json to the correct DSFML:

"lflags" : ["-L/home/parallels/dtanks/DSFML/Linux64"],

Then run dub:

dub

On a fresh install of ubuntu I got this:

Linking...
/usr/bin/ld: cannot find -ljpeg
/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLU
/usr/bin/ld: cannot find -lfreetype
/usr/bin/ld: cannot find -lGLEW
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: cannot find -lXrandr

So I installed the missing dependencies like this:

sudo apt-get install build-essential libjpeg-dev libgl1-mesa-dev libglew-dev libfreetype6-dev libxrandr-dev

Next I ran dub again and found it could not find the shared libraries. The shared libs just need to be on your path. An easy way to do this is to export the LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/home/parallels/dtanks/DSFML/Linux64

Now when I run dub the tanks game pops up (although running on a VM is super slow but it works)

Windows (Windows 8.1)

I've tested this with Windows 8.1 running on Parallels on OSX

first go and install git for windows (ideally the one with gitbash) Then using gitbash:

git clone https://github.com/masterthought/dtanks.git
cd dtanks

Then point the path in the dub.json to the correct DSFML: (note the path should be pointing at the Win32/lib/dmd directory for the lflags and on windows the string starts with a + as opposed to linux which starts with -L)

"lflags" : ["+C:\Users\kings\dtanks\DSFML\Win32\lib\dmd\"],

Then open a CMD window and navigate to the dtanks folder (it won't work in gitbash):

dub

I got a message saying that the dsfml-graphics-2.dll could not be found so to fix that you just need to put the correct DLL's on the path. So I copied all the dll's from dtanks/DSFML/Win32/bin to the root of the dtanks folder. (Note: The Dll's are in dtanks/DSFML/Win32/bin)

and then running:

dub

The game pops up (again incredibly slow as running on a VM for me)

TroubleShooting

If the precompiled binaries shipped with DSFML don't work on your setup you can build your own from source.

Building from Source (Ubuntu)

First make sure you have cmake:

sudo apt-get install cmake

Next grab the DSFML-C library:

git clone https://github.com/Jebbs/DSFML-C.git
cd DSFML-C

And then make sure you have all the required dependencies - when I tried to build I was missing some:

sudo apt-get install libopenal-dev libsndfile1-dev  

And then make it:

cmake .
make

Then copy the contents of the lib directory that was generated into dtanks/DSFML/Linux64 and then continue as usual:

rm -rf /home/parallels/dtanks/DSFML/Linux64    
cp -a /home/parallels/DSFML-C/lib /home/parallels/dtanks/DSFML/Linux64