How to compile TPT++?

  • abczyx123987
    29th Aug 2012 Member 2 Permalink
    Can someone who knows how to compile TPT++ from source tell me how you do it? I don't know how to use SCons to compile (I keep getting an error and I don't know what's causing it). Apparently, though, if you don't use SCons, you do at least have to run the generator.py script...but I also don't know how to run that, since it seems like the script needs certain arguments for it and I don't know what they are. So does anyone know how to compile TPT++? (I'm on a Windows computer, if it makes any difference)
  • plypencil
    29th Aug 2012 Member 0 Permalink

    On a windows computer, don't have a clue. Never had a successful build. But here is a poke in the right direction 'minGW' and 'cygwin'. I think the compiler is gpp.exe as opposed to gcc.exe.

     

    I use a virtual machine with linux to compile.

  • boxmein
    29th Aug 2012 Former Staff 0 Permalink
    @plypencil (View Post)
    "gcc" is the GNU Compiler Collection. It will auto-detect which compiler to use.
    Also, the new system is to use "scons", a scripted compiling system which might be hard to set up, but using it will just be "scons --win" and "scons --lin"
  • abczyx123987
    1st Sep 2012 Member 0 Permalink
    I've been having trouble getting SCons to work (on Windows, that is) -- the furthest I've gotten with it is past the point where it checks for Lua, and then I get an error saying that it couldn't find a certain header file in the 'build' subdirectory.

    Does anyone know how to run the generator.py script (specifically, which arguments it's supposed to take)?
    I'm sure I can figure the rest out on my own once I know exactly how that script works.
  • jacksonmj
    2nd Sep 2012 Developer 0 Permalink
    Last time I tried with scons, I couldn't get it to build on Linux ("scons: *** can't find header file: PowderToypp/build/src/simulation/SimulationData.h Stop"). However, I did work out a while ago how to build it manually.

    generator.py is run twice, once to process the element files and once to process the tool files.

    Argument 1: action. "elements" or "tools"
    Argument 2: source code output filename. "ElementClasses.cpp" or "ToolClasses.cpp".
    Argument 3: header file output filename. "ElementClasses.h" or "ToolClasses.h".
    Remaining arguments: input filenames (all .cpp files in src/simulation/elements or src/simulation/tools)

    It doesn't matter where the output files go, as long as the headers are in one of the include search paths, and the source files get compiled and linked in with the rest of the game.

    For example, on Linux I might do:
    python generator.py elements generated/ElementClasses.cpp generated/ElementClasses.h `find src/simulation/elements -name \*.cpp`
    python generator.py tools generated/ToolClasses.cpp generated/ToolClasses.h `find src/simulation/tools -name \*.cpp`
  • InfinityCoder
    24th Jun 2019 Member 0 Permalink

    My scons is saying that it couldnt find LibSDL2Main

  • Cracker1000
    25th Jun 2019 Member 1 Permalink

    @InfinityCoder (View Post)

     The scons guide isn't usefull anymore, also please use search next time. Anyway see the explainations in this Thread.