Develop for the Amiga with Eclipse in C/C++

If you want a full C/C++ development environment for the Amiga, you may follow these steps. The reward is You'll need some stuff on your PC plus and one program on the Amiga side.
Also note that you have to patch eclipse due to an unfixed bug. Voting for this could help to officially fix the bug.

My Coordinates

These are the folders I use
Tool Windows Linux
Eclipse IDE D:\Amiga\eclipse-cpp /home/stefan/amiga/eclipse
Amiga HD D:\Amiga\MyWB31 "/home/stefan/snap/fsuae/18/Documents/FS-UAE/Hard\ Drives/hd0"
Amiga test folder D:\Amiga\MyWB31\test "/home/stefan/snap/fsuae/18/Documents/FS-UAE/Hard\ Drives/hd0/test"
Amiga-GCC folder d:\msys64\opt\amiga /opt/amiga

Installation Step By Step

I try to keep it short and simple. Do all steps as described below:
ToDo Windows Linux
download and install an Amiga Emulator with Workbench 3.1+ get and install WinUAE and install your WB get and install FS-UAE and install your WB
Enable TCP/IP Networking enable bsdsocket.library windows-bsdsocket.png enable bsdsocket.library linux-bsdsocket.png
create the test folder
I also created a symbolic link from the toplevel folder 'test' to have a shorter path later on
md D:\Amiga\MyWB31\test
junction d:\test D:\Amiga\MyWB31\test
mkdir "/home/stefan/snap/fsuae/18/Documents/FS-UAE/Hard\ Drives/hd0/test"
sudo ln -s "/home/stefan/snap/fsuae/18/Documents/FS-UAE/Hard\ Drives/hd0/test" /test
download bgdbserver and copy it to the Amiga's test folder copy to D:\test copy to /test
install the amiga-gcc toolchain download and install my amiga-gcc toolchain or build the toolchain yourself install the archive amiga-gcc.tgz or build the toolchain yourself
download and install Java JDK if not present Java JDK from Oracle install OpenJDK using your Linux system tool
download and install Eclipse select the Eclipse IDE for C/C++ Developers package for your platform select the Eclipse IDE for C/C++ Developers package for your platform
download the patched package org.eclipse.remote.telnet.core_1.0.0.201803121903.jar and overwrite the existing plugin in the plugins folder copy to D:\Amiga\eclipse-cpp\plugins copy to /home/stefan/amiga/eclipse/plugins
that's it? almost...
  1. Start Eclipse and create an workspace (e.g. /home/stefan/amiga/workspace).
  2. Select Help -> Install New Software ... then press [Add...] then enter "BebboSoft Tools" as name and "https://bebbosoft.de/updatesite" as location. add-bebbosoft-repo.png
  3. Unselect [Group Items by Category], Select "Amiga CDT Integration" (unselect 'Contact all update sites...') and press [Next], [Next], accept the license and [Finish]. Finally click "Install anyway".
  4. Restart Eclipse

Some Eclipse Settings Recommendations

Open the Preferences via the menu Window->Preferences
Filter Text Setting Why
Compare/Patch Ignore white space do you really care about invisible stuff?
Quick Diff keep all eneabled and select "A Git Revision" the changes to your last commit (or selected baseline) are marked
Workspace set text file encoding to US-ASCII the Amiga does not know utf-8 (yet).
Build select "Build configurations only when ..." it's under C/C++ and helps if there are many open projects
Chain make the Cross GCC Toolchain preferred helps

The first Amiga Project

  1. Create a new project via the menu File->New C/C++ Project.
  2. Select C Managed Build
  3. Enter the project name "helloworld" and select the Hello World ANSO C Project
  4. click [Next] until you have to enter the Cross Compiler Prefix and the Cross Compiler Path. Then enter "m68k-amigaos-" and the path to the bin folder (e.g. "/opt/amiga/bin")
Now you should see the source of the hello world example. The includes are resolved and no errors appear.
Open the project's settings and
  1. Binary Parsers: select the Amiga Executable .
  2. Build Steps: add a post build step
    cp ${ProjName} /test
  3. Tool Settings: add the miscellaneous flag "-g" to the Cross Gcc Linker
Apply and close then rebuild the project.
Grats - you've build your first C Project with Eclipse for the Amiga.

First Debug

  1. Start your Amiga Emulator, enter the "test" folder which must contain the bgdbserver binary.
  2. Start on your Amiga Emulator: bgdbserver -r
  3. In Eclipse select "Debug As -> Debug Configurations"
  4. Create a new C/C++ Remote Application entry
  5. Create a new Connection using telnet, host 127.0.0.1 and port 514.
  6. Enter the program with path "/test/hello-world"
  7. On the debugger tab select the Amiga debugger (e.g. "/opt/amiga/bin/m68k-amigaos-gdb"
first-debug.png
Now press debug. The program will break at main (which can be disabled
Here is a screenshot of a "more complex" hello world:
debug-helloworld.png bgdbserver-amiga.png
Oh! argv[0] is not yet correct^^

> fixed in bgdbserver >= 0.5


Feedback, Discussion, Flame Wars

There you go: http://eab.abime.net/showthread.php?t=93055
rev: 1.19