Building from source

edited March 2015 in EmptyEpsilon
I've found I like emptyEpsilon. I've played with Artemis and found it fairly polished looking, but I have a distinct preference for the graphics in emptyEpsilon (Radar - cool) as well as the fact that source is available. I began to wonder if I could get it up on my unix machines (and I'd love to interface some hardware too ). Anyway, I downloaded source for the game, SeriousProton, and SFML to my unix machine, fired up CodeBlocks, and spent several hours trying to figure out why SeriousProton files couldn't be opened until I noticed that CodeBlocks expected the files to be in the directory "SeriousProton", not "SeriousProton-master". Then voila, everything compiled with no errors until it came to looking for SFML libraries. Couldn't find them. At least I assume it's looking for libraries to link to.  it's looking for something like:

ld       -lsmfl -window -d


I'm fairly new to CodeBlocks - can anyone point me in the right direction?




  • Rename the SFML folder to SFML-2.1. 
    Also make sure you choose the right Build. Linux Debug/Linux Release for Linux, Debug/Release for Windows.
  • Thanks for the reply - Directory is SFML-2.2 which agrees with EmptyEpsilon.cbp file and linux debug is selected. I'm thinking maybe codeblocks needs search directories properly set up but I'm not sure just how.

  • Last I saw SFML-2.2 was only for Windows builds. Haven't tried it on Linux.

    Here's what your directory structure should look like:


    If you're just trying to build it, you can use the the python script.
    python debug
    python release
  • Kwadroke is right, the codeblocks file asumes that the SFML files are located one folder above the location of the project file.

    If i remember correctly, Ubuntu doesn't have the latest version of sfml precompiled, so you will need to do that yourself.
  • I've setup a bunch of debian jessie installed laptops at the office. I used the following script, it installs X as well, including dependencies for 3D acceleration.

    It installs SFML in /usr/local/

    sudo apt-get -y update
    sudo apt-get -y install git build-essential libx11-dev cmake libxrandr-dev mesa-common-dev libglu1-mesa-dev libudev-dev libglew-dev libjpeg-dev libfreetype6-dev libopenal-dev libsndfile1-dev unzip
    sudo apt-get -y install xserver-xorg-core xserver-xorg-input-all xserver-xorg-video-all xinit alsa-base alsa-utils firmware-linux firmware-linux-free firmware-linux-nonfree
    cd SFML-2.2
    cmake .
    sudo make install
    sudo ldconfig
    cd ..
    cd EmptyEpsilon

  • Building on OS X, slightly farther than I was previously. 
    I copied over all the frameworks files from SFML distribution (2.2) into /Library/Frameworks

    Now running into this:

    [20%] clang++ -stdlib=libstdc++ -lstdc++   -std=c++11 -Wall -I../SeriousProton/src -Isrc -O2 -o _build_Darwin_MacOS_Release/b2Rope.o -c ../SeriousProton/src/Box2D/Rope/b2Rope.cpp

    [21%] gcc  -std=c++11 -Wall -I../SeriousProton/src -Isrc -O2 -o _build_Darwin_MacOS_Release/glew.o -c ../SeriousProton/src/GL/glew.c

    error: invalid argument '-std=c++11' not allowed with 'C/ObjC'

  • edited July 2015
    daid can better answer this than I, but, my guess is that you will need to use GCC instead of Objective C.

    Update, you might try replacing -std=c++11 with -std=c++0x using Objective C.
  • Note, SFML-2.3.1 is a requirement now (due to the android port)

    The error is my mistake. On linux this is a warning and not an error, but it also happens. It's that the C++ flags are being applied on C compiling, while they should not.
  • Hmm.  Objective C is the language, GCC is the compiler. I am using GCC, but your comment makes me think that I'm trying to compile with a different version of the C language than expected. Though gcc on OS X should have no trouble with C++11

  • "Objective C" is not the language "C" is the language it is compiling that file for. Which is correct. However, for C "C++11" is not a valid standard to compile for. Which is an error in my build scripts.
  • edited July 2015
    I'm not much up on OSX. Removed it from my Mac Mini years ago. Kept trying to make it work like Linux.
    Guess I'm getting my terminology mixed up.
  • I pushed a small CMake change which I hope will solve the C++11 issue that sircastor is having.

  • Unfortunately it's still failing on the same line: 

    [20%] gcc  -std=c++11 -Wall -I../SeriousProton/src -Isrc -O2 -o _build_Darwin_MacOS_Release/glew.o -c ../SeriousProton/src/GL/glew.c

    error: invalid argument '-std=c++11' not allowed with 'C/ObjC'


  • Darn it. What version of CMake are you using?

  • And GCC version, if it helps. 

    aeiche$ gcc --version

    Configured with: --prefix=/Applications/ --with-gxx-include-dir=/usr/include/c++/4.2.1

    Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)

    Target: x86_64-apple-darwin14.4.0

    Thread model: posix

  • Ok, that's helpful. As CMake 3.1 added a feature that assists in setting the C++11 flag.

    Hope this change does it then:
  • Sadly, no difference there. If I'm reading the script right though, it isn't doing anything different. As I'm using 3.2.2 it's still calling the -std=c++11

  • Well, the code is a mix of "plain C" and "C++" code. The C++ code requires the -std=c++11 flag. But the "plain C" code does not.

    The clang compiler Mac is using does not allow the c++11 flag on plain C code. While GCC (compiler I'm using on windows and linux) does.

    What I modified is that when you are using CMake 3.1 or newer, then CMake handles adding this flag. However, according to the CMake documentation, it should only add this flag to C++ code then, not plain C code. So I am confused...

    Can you post the full output of a "make VERBOSE=1" ? (yes, it will be a lot, better use )
  • How should I be approaching building this? I've been using the python build script, and I've attempted a few times to simply run 'cmake .'

    What's most appropriate/expected.
  • Ahhh, ok, I thought you where using cmake. The python script is not using cmake, and actually has a bunch of bugs. This is one of them.

    Let me see if I can add a small change.

    Note, CMake is the replacement for the python script, however, I have no idea how well it will work for OSX.

  • Okay - So I should use CMake to build. I will give that a shot and see if I can get it to build where the python script wouldn't.

  • Progress! ( I was hoping for completion, but hey, I got to building)

    Below are the errors for the build. I was running into an issue being unable to find a file. A couple of tests later, and I realized that the cmake script couldn't find the SeriousProton source files at all. So I threw this line in: 

    set(SERIOUS_PROTON_DIR "/Users/aeiche/Development/EE/SeriousProton/")

    Then everything in the cmake script seemed to work okay. 
    Running make however, failed with the following errors: 

    [ 60%] Building CXX object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/Renderable.cpp.o

    [ 61%] Building CXX object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/Updatable.cpp.o

    [ 61%] Building CXX object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/textureManager.cpp.o

    [ 62%] Building CXX object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/collisionable.cpp.o

    [ 62%] Building CXX object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/stringImproved.cpp.o

    [ 62%] Building CXX object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/resources.cpp.o

    /Users/aeiche/Development/EE/SeriousProton/src/resources.cpp:48:9: error: no type named 'FileInputStream' in namespace 'sf'; did you mean


        sf::FileInputStream stream;



    /usr/local/include/SFML/System/InputStream.hpp:40:7: note: 'InputStream' declared here

    class InputStream


    /Users/aeiche/Development/EE/SeriousProton/src/resources.cpp:48:25: error: field type 'sf::InputStream' is an abstract class

        sf::FileInputStream stream;


    /usr/local/include/SFML/System/InputStream.hpp:62:19: note: unimplemented pure virtual method 'read' in 'InputStream'

        virtual Int64 read(void* data, Int64 size) = 0;


    /usr/local/include/SFML/System/InputStream.hpp:72:19: note: unimplemented pure virtual method 'seek' in 'InputStream'

        virtual Int64 seek(Int64 position) = 0;


    /usr/local/include/SFML/System/InputStream.hpp:80:19: note: unimplemented pure virtual method 'tell' in 'InputStream'

        virtual Int64 tell() = 0;


    /usr/local/include/SFML/System/InputStream.hpp:88:19: note: unimplemented pure virtual method 'getSize' in 'InputStream'

        virtual Int64 getSize() = 0;


    2 errors generated.

    make[2]: *** [CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/resources.cpp.o] Error 1

    make[1]: *** [CMakeFiles/EmptyEpsilon.dir/all] Error 2

    make: *** [all] Error 2

  • That's an error because you are building against SFML-2.2 instead of SFML-2.3.1

    It's not finding the "FileInputStream" class, which is new in SFML-2.3.1, and allows me to read files the same way on an desktop as on Android.

    So, you need to upgrade to SFML-2.3.1
  • -Ok
    Grabbed source for EmptyEpsilon, SeriousProton, SFML-2.3.1
    Built SFML, installed to /usr (libs, includes etc).. 
    Built EmptyEpsilon after copying src dir from SeriousProton-master to EmptyEpsilon-master. make clean&&make&&sudo make install
    all successful some warnings:

    In file included from /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/spaceObjects/spaceship.h:5:0,
                     from /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/spaceObjects/playerSpaceship.h:4,
                     from /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/gameGlobalInfo.h:4,
                     from /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/hardware/hardwareController.cpp:4:
    /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/spaceObjects/spaceObject.h: In constructor ‘DamageInfo::DamageInfo()’:
    /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/spaceObjects/spaceObject.h:26:5: warning: ‘DamageInfo::instigator’ is initialized with itself [-Winit-self]

    /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/networkRecorder.cpp: In member function ‘virtual bool NetworkRecorder::onProcessSamples(const Int16*, std::size_t)’:
    /home/jgreene/EmptyEpsilon/EmptyEpsilon-master/src/networkRecorder.cpp:39:1: warning: no return statement in function returning non-void [-Wreturn-type]

    but they were just warnings and compile completed. 
    Then this: 
    mckinleystation$ /usr/local/bin/EmptyEpsilon 
    Failed to open shader file "resources/glitch.frag"
    Failed to open shader file "resources/warp.frag"
    Segmentation fault (core dumped)

  • I'll note that the 2 files mentioned exist and are readable by all in /usr/local/share/resources

  • edited August 2015
    Bah! it works if I first change to /usr/local/share before starting.. so the problem is either a missing env var or a bad path in the code
    relative path in main.cpp for the resources/ packs/ and scripts dirs
    I utilized the following code fix:
    Inserted 12 lines before main.cpp line 65: 
        new DirectoryResourceProvider("~/.emptyepsilon/resources/");
        new DirectoryResourceProvider("~/.emptyepsilon/scripts/");
        new DirectoryResourceProvider("~/.emptyepsilon/packs/SolCommand/");
        new PackResourceProvider("~/.emptyepsilon/packs/Angryfly.pack");
        new DirectoryResourceProvider("/usr/local/share/resources/");
        new DirectoryResourceProvider("/usr/local/share/scripts/");
        new DirectoryResourceProvider("/usr/local/share/packs/SolCommand/");
        new PackResourceProvider("/usr/local/share/emptyepsilon/packs/Angryfly.pack");
        new DirectoryResourceProvider("/usr/share/resources/");
        new DirectoryResourceProvider("/usr/share/scripts/");
        new DirectoryResourceProvider("/usr/share/packs/SolCommand/");
        new PackResourceProvider("/usr/share/emptyepsilon/packs/Angryfly.pack");

    I also moved the resources/ packs/ and scripts/ directories to /usr/local/share/emptyepsilon
  • I feel like I'm very close. I did a 'make clean' and 'make all'. The compiler crunched through everything, and at 100% spit out this:

    [100%] Building C object CMakeFiles/EmptyEpsilon.dir/Users/aeiche/Development/EE/SeriousProton/src/lua/lbitlib.c.o

    Linking CXX executable EmptyEpsilon

    Undefined symbols for architecture x86_64:

      "_CFBundleCopyResourcesDirectoryURL", referenced from:

          _main in main.cpp.o

      "_CFBundleGetMainBundle", referenced from:

          _main in main.cpp.o

      "_CFRelease", referenced from:

          _main in main.cpp.o

      "_CFURLGetFileSystemRepresentation", referenced from:

          _main in main.cpp.o

    ld: symbol(s) not found for architecture x86_64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    make[2]: *** [EmptyEpsilon] Error 1

    make[1]: *** [CMakeFiles/EmptyEpsilon.dir/all] Error 2

    make: *** [all] Error 2

  • VolgClawtooth installing on Linux is still broken. But shouldn't take me that long to fix.

    @sircastor just pushed a small change which I think will fix that linking error. (Almost there!)
  • edited August 2015
    I  made those resource changes and bang.. success. I played a round last night.. very impressed thus far. Very impressed. Although I still have to move those resource /packs and scripts dirs manually after install as I cannot seem to determine where cmake is getting the datadir spec from.. I'll find it though.. It's how I roll


Sign In or Register to comment.