No announcement yet.

Compiling TSRE

First Prev Next Last
  • Filter
  • Time
  • Show
Clear All
new posts

  • TrainSimJack
    Originally posted by yellowdog
    After running the Hammer and having it go through a lot of work, it finally gives me a fail message at the end:

    make.exe[2]: *** [dist/Release_x64/MinGW_1-Windows/TSRE5.exe] Error 1
    make.exe[2]: Leaving directory `/c/Users/xxxxxx/Documents/NetBeansProjects/TSRE5'
    make.exe[1]: *** [.build-conf] Error 2
    make.exe[1]: Leaving directory `/c/Users/xxxxxx/Documents/NetBeansProjects/TSRE5'
    make.exe": *** [.build-impl] Error 2

    BUILD FAILED (exit value 2, total time: 8m 32s)

    TrainSimJack, is that what you're seeing in post 49? I did check the path for the Make command. It is correct. Although it's the only path pointing to MinGW. Everything else is pointing to QT. I don't have a make.exe (or similar) in QT.

    I'm done for the night. Hopefully someone will have answers in the morning! ​​
    My Build Failed at first due to a path in netbeans that I thought I updated for openal-soft..

    Now my build works, but my exe does not.

    Running TSRE5.exe from c:\code\TSRE5\dist\Release_x64\MinGW-Windows\TSRE5.exe originally brought up errors about missing dlls (the ones that are documented in the notes above)
    So I copied all of those but still get an error "OpenAL32.lib was not found"
    So I copied that file over and get:

    It also does not run from within netbeans.​
    Attached Files

    Leave a comment:

  • yellowdog
    After running the Hammer and having it go through a lot of work, it finally gives me a fail message at the end:

    make.exe[2]: *** [dist/Release_x64/MinGW_1-Windows/TSRE5.exe] Error 1
    make.exe[2]: Leaving directory `/c/Users/xxxxxx/Documents/NetBeansProjects/TSRE5'
    make.exe[1]: *** [.build-conf] Error 2
    make.exe[1]: Leaving directory `/c/Users/xxxxxx/Documents/NetBeansProjects/TSRE5'
    make.exe": *** [.build-impl] Error 2

    BUILD FAILED (exit value 2, total time: 8m 32s)

    TrainSimJack, is that what you're seeing in post 49? I did check the path for the Make command. It is correct. Although it's the only path pointing to MinGW. Everything else is pointing to QT. I don't have a make.exe (or similar) in QT.

    I'm done for the night. Hopefully someone will have answers in the morning! ​​

    Leave a comment:

  • TrainSimJack
    Yellowdog, per post #48: Hmm, that is interesting - I tried a bunch of times with no luck until I switched project types.
    I do remember hitting "Check for Updates" and "Check for Newest" on the first two tabs of the Plugins page in Netbeans - I see 125 available plugins.

    Per post 50, I'm stuck there too.

    Leave a comment:

  • yellowdog
    So I was able to get through Step 7, and even had all of the paths filled in correctly already, except I had to enter the QMake location at the bottom. Clicked the Hammer button and now get this error (although the Preparing to Build Host box actually opens second and is on top of the error--I waited several minutes, but nothing happened....)

    More internet searching took me here:
    After installing cygwin, the Hammer works! It's creating the output now....
    Attached Files

    Leave a comment:

  • TrainSimJack
    Originally posted by pgroenbaek
    So, as promised, here's how to get the current TSRE5...

    ...But if you need more details in regards to something, just ask and I'll clarify....

    ...Let me know if you encounter any difficulties....

    pgroenbaek - I think I've got almost all of this except the make.exe file

    I installed minGW and it looks like it just has this Installation Manager - do you know what package I need to get msys\make.exe ?
    (Note, QT also has a minGW as part of it's install, but that one doesn't have a msys folder, and there's no make.exe anywhere in the qt folder structure.)

    edit, I'm going to try installing mingw32-base and see what happens....
    edit 2 - nope, or sort of nope, I have a mingw32-make.exe - not sure if this should be renamed, but a post on the internet suggested doing that.
    edit 3 - I installed the "MSYS" branch above, and in the package list is a make, I now have a make.exe:

    Attached Files

    Leave a comment:

  • yellowdog
    Thanks for more experimenting! But your last post doesn't resolve anything for me. In fact, mine is still very different. I am using the NetBeans 8.2 Plugin Portal:

    But you have a lot more available plugins than I do.

    I don't have CPPLite Kit as a standalone option. And my C/C++ is an earlier version.

    I've tried to run the Update from the Help menu, but it says I have no updates. I also have no updates in the Plugins tab.

    However, mysteriously.....whenever I just right-clicked on my TSRE5 project, I now have the full menu. Not sure what changed.....
    Attached Files

    Leave a comment:

  • TrainSimJack
    Originally posted by yellowdog
    Also, mine looks a lot different
    I think I may have figured this one out.

    I was using the included C++ plugin.
    but I think the one that works is the old one.

    Go to the Tools menu-> Plugins ->Settings tab.
    Check that Netbeans 8.2 plugin portal.

    Then back on the Available plugins tab, sort by name and install the C/C++ one as shown below (note the source is NetBeans 8.2 Plugin Portal)

    You don't want the red one - that's the one that comes with Netbeans 20, Pick the C/C++ one.
    Attached Files

    Leave a comment:

  • TrainSimJack
    Originally posted by pgroenbaek
    I gave this a try as well -
    Similar problems as Yellow Dog.

    Pgroenbaek - I wonder if you've got a different version of Netbeans?
    When I pulled Goku's code, Netbeans does not see a project - (Though I do see a NBProject folder and some files)
    One thought was that he was using an older version of netbeans, another was that he was using a different OS (ie not windows)
    I wonder if there's a case sensitivity issue going on here.

    Oh and one more thing - In my netbeans install, C/C++ was already installed, but I did have to Activate it.

    Leave a comment:

  • yellowdog
    Also, mine looks a lot different "when the project has loaded" and I have a lot fewer options under Properties than what is displayed above. I also notice that your icon to the left of TSRE5 is different (looks like some sort of QT icon) than mine.

    So I have a feeling that there are things that still need to be defined somewhere within NetBeans, to point to QT and/or something else. After some further internet searching, I tried adding the editor as the MNGW\bin\g++.exe and also qt\qt5.7.0\tools\mingw530_32\bin\g++.exe. But that still doesn't do anything to change the Build options

    Attached Files

    Leave a comment:

  • yellowdog
    This reminded me of rooting my phone….

    I tried to do this as a non-programmer person, so that it would be a “clean” install experience. The process was slightly different for me than what was described, and I eventually got stuck at the same place as Eric. I’m on Windows 11.

    I already had Java 18+ installed, so I didn’t install Java 13+ and instead just unzipped it onto my desktop to get the needed file. When I installed NetBeans, I pointed it to the Java13+ folder when given the option to do so. It installed no problems.

    When I opened NetBeans, C/C++ was already loaded as a plug-in, so I didn’t have to do that. I also received no errors about unpack200.exe. Not sure if both of these differences are related to the fact that I pointed NetBeans directly to Java13+ or what.

    I had to request to create an account to install QT. This generated an email asking me to click on a link to verify an account. But apparently this is optional (albeit somewhat misleading/confusing). QT is over 3gb installed.

    MinGW was the only step that was as described above. Super easy and straightforward to download and install.

    I, too, had to use the Way Back Machine to get the Open AL Soft Binary. And then I got stuck. There is no DLLTool in MinGW, and I get the following result:
    'C:\MinGW\bin\dlltool' is not recognized as an internal or external command, operable program or batch file.

    The path is the same, but dlltool does not exist anywhere in the MinGW folder structure. Poking around in MinGW, I clicked on All Packages and installed the MinGW-Developer-Toolkit on a whim. This installed some sub packages by default, and I just let the defaults install. It took several minutes to install. That installed a lot of other things in the Bin folder, but not dlltool. I noticed G++ was mentioned in the post above, so then I installed the packages related to G++. That did the trick: dlltool was installed and running the command successfully created libopenal32.a in the correct openal subfolder.

    For Step 7, I don’t have a Team->Remote->Clone. Instead, like Eric, I have a Team->Git->Clone. Other than that, the next few directions are straightforward and I followed them. NetBeans creates a progress bar once you ask it to Clone. Once that finishes, is where I got lost. NetBeans doesn’t immediately open the project. Instead it asks if you want to Create Project, with a subobtion to checkbox Open Sources in Favorites.

    I checked Open Sources in Favorites and clicked ”Create Project.” That took me to a completely different menu than what is posted above, with completely different options. I didn’t know what to do, but we’re talking about C++, so I clicked that option.

    That asked me for the path again. I clicked next. And then asked me for the Compile Commands.

    I had no idea what to put in there, so I just clicked Finish. THAT finally brought me to the option to right-click on the project and select Properties.

    But clicking on Properties brought me back to selecting Editor and Build. There's nothing in Build, but clicking on "…" next to Editor/Compile Commands makes me select a folder location. Which is where Eric got to. And, like him, I don’t know where to go from there.

    Attached Files

    Leave a comment:

  • pwillard

    That does make sense Eric, since you can't *RUN* NETBEANS without JAVA... make sense too, since NETBEANS is primarily an IDE for JAVA users. (Though clearly its not limited to JAVA coding)


    I'll can add this writeup as an appendix in the GITHUB TSRE PDF Manual, if you like.

    Leave a comment:

  • eric
    Are Steps 1 and 2 reversed? -- you cannot install NetBeans without a JDK present

    Step 7 -- I didn't have a Team->Remote but I did have Team->Git->Clone

    Using the same steps, I get this when I try to open the project properties:

    Attached Files
    Last edited by eric; 01-19-2024, 01:38 AM.

    Leave a comment:

  • eric
    Thanks for posting this --- I've started downloading the installers before taking on the installation.

    For others who are thinking of doing this --- the QT download is 1Gb, so expect that will take a while. The others were quick, and yes, I had to get that one file from the Wayback Machine.

    Assuming this works (and I have no reason to think it won't), I may host those here so that they're preserved for other developers on this effort until TSRE can be re-platformed or it gets replaced by an official ORTS team product.

    Leave a comment:

  • pgroenbaek
    So, as promised, here's how to get the current TSRE5 codebase from GitHub compiling and running in Windows using the NetBeans IDE.

    I am not going to go into too much detail with things like installing NetBeans, Qt, etc. Because that is easy to do.

    But if you need more details in regards to something, just ask and I'll clarify.

    And you may have to adjust some of the directory paths I specify. That depends on where you choose to install and put things in your system during the first few steps.

    Let's get into it.

    Step 1 - Installing Apache NetBeans 20:

    First you need to install Apache NetBeans 20.

    You can download it from here:

    You'll specifically want the "Apache-NetBeans-20r1-bin-windows-x64.exe" from that page.

    This should be fairly straightforward to install.

    Step 2 - Installing OpenJDK 13.0.2:

    Next you need to install a JDK that MUST be no newer than version 13.0.2.

    There is a very good reason why you need a JDK that's not newer than that.

    You will most likely need a file in the next step that's not available in JDK's that are newer than 13.0.2.

    You can get it from this page:

    Again, this should be fairly straightforward to install.

    Step 3 - Installing the C/C++ plugin within NetBeans:

    Next install the C/C++ within NetBeans.

    You can do this by going to Tools => Plugins in the top menu.

    In the window that opens select "Available Plugins"

    Then find the one called "C/C++". And click install.

    During installation NetBeans will most likely complain that it needs a "unpack200.exe". At least it did for me.

    If it does, point it to the file within the JDK13 you just installed in the previous step.

    The file is located at: C:\Program Files\Java\jdk-13.0.2\bin\unpack200.exe

    Other than that installing the plugin should be without much hassle.

    Step 4 - Installing Qt 5.7:

    Next up you need to install Qt.

    We will need version 5.7 as this is what Goku was using.

    You can download the installer from this page:

    You'll want to specifically download the one for mingw named "qt-opensource-windows-x86-mingw530-5.7.0.exe".

    The installation of Qt should be easy as well.

    Step 5 - Install MinGW:

    Download the MinGW installer from here:

    The installation of MinGW should be also be quite easy.

    Step 6 - Download and set up OpenAL Soft binaries:

    Now you need to download the OpenAL Soft binaries, this is where things start to get interesting.

    You'll specifically need version 1.18.2 from this page:

    As of writing this I am unable to visit the url, and that was not the case two weeks ago when I first did this.

    You can try getting it from here instead if the other does not work for you:

    There is one problem with the binaries you just downloaded though. They don't work with MinGW and g++ out of the box.

    You will always get linking errors if you try to use the libraries directly from the zip file you downloaded.

    So what we need to do is to create the ".a" file that's needed by ourself, and fortunately that is a simple process.

    You will need something called "dlltool" do create it. This is included in the MinGW installation from the last step.

    You'll need to open up cmd.exe and type in the following commands:

    cd C:\openal-soft-1.18.2-bin\libs\Win64
    C:\MinGW\bin\dlltool -d OpenAL32.def -D OpenAL32.dll -k -a -l libopenal32.a -v
    Like this:

    This will create a MinGW compatible library that links successfully when building TSRE5.

    Of course, the paths in the above commands might be different depending on where you have put things in the previous steps.

    Now you should have a file named "libopenal32.a", and we will need this in the next step.

    Step 7 - Configuring the NetBeans build:

    If you haven't done so already, it's time to clone the TSRE5 repository from GitHub.

    In the top menu bar go to Team => Remote => Clone..., that will bring up the following dialog:

    Specify the repository URL as "", and then the local directory you want to clone the repo to.

    Next specify the remote branch. Check "master" if it isn't already.

    Click next.

    The final step should look like something this:

    Then click Finish. NetBeans will now clone the repo and open the project for you.

    When the project has loaded you'll want to right click it, and select Properties:

    First we will need to add some extra Qt linking settings.

    Select "Qt" under categories.

    Then scroll all the way down to the bottom and find "Custom Definitions".

    Next, click on the small button with "..."​

    That will bring up a another dialog where you need to add the following lines:

    LIBS += -lopengl32
    LIBS += -lglu32
    LIBS += -lglut32
    LIBS += -L"C:\openal-soft-1.18.2-bin\libs\Win64"
    Again change the path if necessary, it should look like this when you're done:

    And click OK.

    Next we'll need to change the path for the OpenAL Soft binaries

    Now select "C++ Compiler" under Categories.

    Click the small button with "..." in the "Include Directories" line.

    Then edit the path to where you put the OpenAL Soft binaries, with the ".\include" subdirectory appended to it.

    In my case this is "C:\openal-soft-1.18.2-bin\include":

    Click OK.

    Then go to "Linker" under Categories and specify the path to the "libopenal32.a" file we created earlier.

    In my case this is "C:\openal-soft-1.18.2-bin\libs\Win64\libopenal32.a"

    You can edit the string directly or use the "Add Library File..." button.

    Click OK.

    The final thing we need to do before we can build TSRE5 is to tell NetBeans where Qt and the compiler tools are located.

    Go to "Build" under categories.

    Click the small "..." button in the "Tool collection" line.

    That will bring up the following dialog:

    ​All the fields here will be blank when you open it.

    Here you need fill out all the the fields like above.

    It does not matter whether you create a new Tool Collection or modify an existing one. And you can name it whatever you want.

    When you have filled out the fields click "OK".

    And make sure the Tool Collection that you filled out the fields for is selected like this:

    Now you can compile TSRE5. At least these were the steps I needed to take. Let me know if you are unable to.

    Step 8 - Compile the project:

    It's now time to build. You can do this by clicking the hammer in the toolbar or you can press F11.

    Note that sometimes the build fails with messages like this:

    "mv: cannot move `' to `nbproject/': Permission denied"
    And that's just something you can disregard and try again until it works. I don't know why NetBeans does this occasionally.

    Step 9 - Making the compiled .exe able to start outside of NetBeans:

    When it's been built you can start it within NetBeans with the play button in the toolbar or by pressing F6.

    The built TSRE5.exe is put inside the "./dist" folder of the same directory that you cloned the repository to.

    In my case this is "C:\Users\Peter\Documents\NetBeansProjects\TSR E5\T SRE5\dist\Release_x64\MinGW_1-Windows".

    To run TSRE5.exe outside of NetBeans, there's one more thing we have to do.

    And that is to move a couple of dll's into the directory with the TSRE5.exe file.

    Copy the following dll's from "C:\Qt\Qt5.7.0\5.7\mingw53_32\bin":
    • libstdc++-6.dll
    • libgcc_s_dw2-1.dll
    • libwinpthread-1.dll
    • Qt5Core.dll
    • Qt5Gui.dll
    • Qt5Network.dll
    • Qt5WebSockets.dll
    • Qt5Widgets.dll
    So that the folder looks like this:

    The reason why these are not present with the TSRE5.exe built by Goku is that they are somehow included in the executable when he builds it.

    And that doesn't happen here for some reason.

    And that's it, you can now run the TSRE5.exe that you've compiled yourself.

    When it starts for the first time it downloads the appdata folders it needs from Goku's webserver and creates the settings.txt file.

    Let me know if you encounter any difficulties.

    Anyway, this is what I needed to do to compile and run TSRE5 on my machine.​

    Hope this guide is useful.
    Attached Files
    Last edited by eric; 01-18-2024, 04:33 PM.

    Leave a comment:

  • pwillard
    I have it running with the g++ compiler in mingw32 through the Apache Netbeans IDE.

    I suspect Goku was using the same setup based on the contents of the /nbproject folder.
    I completely agree with this assessment, btw

    Leave a comment: