Compiling and Debugging 4diac FORTE with Eclipse

Get C/C++ support for Eclipse

  1. Unless you already use Eclipse, for example to build 4diac IDE from source, download Eclipse for C/C++ Developers and unzip the file to a suitable location (e.g., C:\eclipse). Otherwise you can integrate C/C++ functionality into your Eclipse installation by Help → Install New Software, choosing your Eclipse version (1) and checking Programming Languages → C/C++ Development Tools (2).
    Install new software in Eclipse
  2. Restart eclipse.exe
  3. Choose a workspace directory. This will be the directory where your C/C++ projects will be located. It is recommended to set the workspace folder one level above the entire source code folder. Please avoid any spaces in its names. Otherwise you might get problems when compiling 4diac FORTE.

Compile 4diac FORTE with Eclipse

The build process is described in the installation tutorial. Perform the steps described there but consider the following adaption:

Then compile the project as follows:
  1. Import 4diac FORTE by File → Import... → General → Existing Project into Workspace. If your Workspace is one folder above your source code folder you only have to click on Browse... and OK afterwards to import 4diac FORTE into Eclipse. Otherwise, select the directory where you have extracted your 4diac FORTE and check Copy into workspace (otherwise the source will stay at the original place).
  2. Start Make Targets View by Window → Show View → Build Targets unless it is open already. Double-click the makefile: bin/[YOUR_SYSTEM]/all to compile 4diac FORTE to an executable application. If you don't see the targets (all or clean), you can create them in the same window. Make sure that you create them in the correct folder.
    Eclipse C++ with FORTE imported and marked makefiles

Debug FORTE with Eclipse

For debugging your own Function Blocks, go through the following steps:

  1. Set a breakpoint in the source code file of the desired Function Block.
  2. Go to Run → Debug Configurations...
  3. Right click on C/C++ Application → New. In the Main tab, you should fill the C/C++ Application: with the binary file you generated (normally FORTE_FOLDER_ROOT/bin/[YOUR_SYSTEM]/src/forte[.exe]). In the Debugger tab, choose your desired debugger. In Windows you normally use Cygwin or MinGW (you have to install them in order for them to appear in the selection box).
    Eclipse Launch Debug Configuration Selection
  4. Click Debug.
  5. Confirm for changing into the Debug view.
  6. If you don't see the file where the debugger stopped at the beginning, press the Locate File button (1) and navigate to the Eclipse workspace which contains the extracted 4diac FORTE, type main into the search field of the Windows Explorer and select main.cpp. 4diac FORTE is now stopped at the main() function.
    Eclipse C++ Debug View
  7. Press the Resume button (2) to run 4diac FORTE and observe the behavior of your application.
  8. Always press the Terminate button for stopping a 4diac FORTE launched within Eclipse. This avoids 4diac FORTE running in the background (not always shown in Task Manager).

Where to go from here?

If you want to build a 4diac FORTE, here is a quick link back:

Install Eclipse 4diac

After you installed all required tools, it's time to start using them. Take a look at the following page:

Step by step tutorial

If you want to go back to the Start Here page, we leave you here a fast access

Start Here page

Or Go to top