If you ever wanted to use the Visual Studio IDE to write Amiga programs, that is what this document is about. This document uses Visual Studio 2005 as it's baseline since it has a very nice IDE, especially with plug-ins like Visual Assist (I think you can use the same directions for VS 2008 but since I don't have that I can't guarantee it).
Getting started:
-Download/acquire Visual Studio 2005. You may already have this, or you can get Visual Studio 2005 Express which is free. Install it.
-Download cygwin from
http://www.cygwin.com . It will just give you a setup.exe file. Install it, and make sure you select "make" to be installed for the setup (it's under the development heading). (I'm sure gcc experts out there will have a bunch of other recommendations, but I'm use to VS not gcc, so I'm unfamiliar with all the gcc tools).
-Download the Cross compiler(s) you want from
http://cross.zerohero.se . I've tried both the OS4 and OS3.x and they both work, and they can co-exist side by side. (If you are like me and like to compile on the go on your laptop, testing things out under OS3 via WinUAE can be useful!) Grab all the i686-cygwin for the compiler you want (or both) and any supporting files (including the SDK if OS4). The documentation on the particular webpage describes what you want to do with them. Install the ones you want to use, using the paths created by Cygwin that look like Unix. (ie. most of the stuff wants to be uncompressed to /usr/local which in my case is D:/cygwin/usr/local)
Configuring:
-You'll need to put the bin for the compilers in the Windows path. To do that you go to Start->Settings->Control Panel->System.
Click on the Advanced Tab and clock on Environment Variables. Find the path variable. Tack on where you installed your compiler and cygwin's bin path. (Ie. for me it is D:\cygwin\bin;D:\cygwin\usr\local\amiga\bin ) This will allow VS to call your gcc compiler.
-Open up VS, make a new project. Use Visual C++->General->Makefile Project. It will bring up a "wizard" to set certain configurations. Click "next" to go to the debug configuration. Under "Build Command line" put "make -f makefile.mak 2>&1 | sed -e 's/\(\w\+\):\([0-9]\+\):/\1(\2):/'" (Remove the double quotes, but leave the single quotes). Put the same for the rebuild. Under Clean, put "make -f makefile.mak clean". (Keep in mind that it's specifying the makefile as makefile.mak, so change that if you want it a different name)
And you are all done! You can start importing your C/C++ files into the project (and your makefile!). If you don't have a make file yet, you'll have to make one, but there is plenty on the net about that (although, honestly, I wouldn't mind a tutorial about that myself). A sample REALLY basic one would be:
CC=ppc-amigaos-gcc {This can either be m68k-amigaos-gcc or ppc-amigaos-gcc depending if you are trying for OS3.X or OS4 respectively)
CFLAGS= {compiler flags go here such as -ggdb}
CPPFLAGS = {preprocessor stuff goes here such as -D __USE_INLINE__}
objects = {your final object files, such as main.o. It assumes that if there is a main.o there is a main.c that compiles into it. This objects variable is here to make things easier}
{EXE name}: ${objects}
clean:
{tab which won't show up on a webpage}rm -f ${objects}
Here is a REAL example...take this as literal:
CC=ppc-amigaos-gcc
CFLAGS= -ggdb
CPPFLAGS = -D GOWSP
objects= GLTest.o
GLTest: ${objects}
clean:
rm -f ${objects}
A couple things to keep in mind, the debugger won't work with your new program. You'll have to use an Amiga debugger such a gdb under OS4. I heard that it is possible to setup remote GDB to work with VS, but I haven't even attempted that yet. Another thing is that while VS keeps around preprocessor information, it ends up being only for itself, and won't change your compile at all. Everything that you change MUST be in your make file. I wish VS would export the preprocessor directives in an environment variable like it does everything else, but I couldn't find it. Otherwise, it could pass it to the make file! (Perhaps someone wiser than me knows the answer).
Have fun coding!