Instructions to compile the C++ version?

  • The-Fall
    3rd Oct 2012 Member 1 Permalink

    I am aware of how to comile a program in C++, however we appear to be missing the instructions for compiling a modified verion of the source in C++.

  • abczyx123987
    3rd Oct 2012 Member 0 Permalink
    First you'll need to run the generator.py script twice, as described in this post:
    https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=14866&PageNum=0#Message=219259

    Then you just gather all of the .cpp and .h files (should just be equivalent to adding all of the .cpp and .h files to the project, assuming you use an IDE to compile) and compile everything. (sorry, that's not very descriptive, I know, but I'm new to this too)
    The flags should be roughly the same as in the old (written in C) TPT, though I think you also need to do -DWIN (for MSVC++, add WIN to the preprocessor options) if you're compiling for windows.
    And if you're using Code::Blocks (or just MinGW in general), I *think* you also need to add -fkeep-inline-functions to the compiler flags.

    The linker flags should also be the same, except you also need the zlib library (I think).
  • jacob1
    3rd Oct 2012 Developer 0 Permalink
    Are you using visual studio? For that, I will update the wiki sometime. Without it, you need python, then install scons, then get the libraries, then do --scons --win --sse3 --sdl-dir (path to sdl libraries) --lua-dir (path to lua libraries) (last 2 optional and may not be needed I think, but I did). I can't really remember the scons way enough.
  • The-Fall
    3rd Oct 2012 Member 0 Permalink

    Yes, I will indeed (Have) to use Visual studio. Im atleast comfortable in using it.