I'm writing this from memory, so please excuse if its not 100%.
I use Bloodshed C++ (it's free and easy to use), but the basic steps should be about the same for any IDE (I will also paste in a working makefile that others can modify for those of you coding l33t style).
Basic Notes:
This assumes you have OpenXDK installed in the default location, that you've configured cygwin properly, and installed cygwin to C:\cygwin.
Setting up the IDE1) Create a new Win32 Application, checking C++ project.
2) Goto Tools->Compiler Options
3) Click on the Plus to create a new Compiler, name it Xbox
4) Check the box next to 'Add these commands when calling compiler' and put the following into the box:
CODE
-c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM
5) Check the box next to 'Add these commands to the linker command line' and put the following into the box:
CODE
-nostdlib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20 -shared -Wl,--entry,_WinMainCRTStartup -Wl,--strip-all -lstdc++ -lSDL -lopenxdk -lhal -lc -lhal -lusb -lc -lxboxkrnl
6) Click on the Directories tab
7) Put "C:\cygwin\usr\local\openxdk\bin" (without quotes) into the bottom box and click the Add button.

Click the Libraries tab
9) Add the following directories:
CODE
C:\cygwin\usr\local\openxdk\i386-pc-xbox\lib
C:\cygwin\usr\local\openxdk\lib
10)Click the C Includes Tab
11)Add the following directories:
CODE
C:\cygwin\usr\local\openxdk\i386-pc-xbox\include
C:\cygwin\usr\local\openxdk\include
C:\cygwin\usr\local\openxdk\include\SDL
12)Click the C++ Includes tab, and add the same directories as in step 11.
13)Click the Binaries tab
14)Next to gcc put "i386-pc-xbox-gcc" (without the quotes)
15)Next to g++ put "i386-pc-xbox-g++" (without the quotes)
16)Next to windres put "i386-pc-xbox-windres" (without the quotes)
17)Click OK
18)Click Project->Project Options
19)Click on the Compiler tab
20)From the Compiler drop down box, select Xbox
21)Click on the Build Options tab
22)Check the box next to 'Override Output filename' and put "default.exe" in the box (without quotes)
23)Click OK
For all subsequent projects, you only need to do steps 1 and 18-23.Setting up CXBE as a tool1) Click Tools->Configure tools
2) Click the plus to add a tool
3) In the Title box put "CXBE" (without quotes)
4) In the Program box put "C:\cygwin\usr\local\openxdk\bin\cxbe.exe" (without
quotes)
5) In the Working Directory box put "<PROJECTPATH>" (without quotes)
6) In the Parameters box put:
CODE
-TITLE:"
" -DUMPINFO:".cxbe" -OUT:"default.xbe" default.exe7) Click OK

Click Close
Setting up and Compiling the Code1) Around any C libraries, you must put 'extern "C" {}'
2) Here's an example of the library calls:
CODE
// Includes
extern "C" {
#include
#include
#include
#include "Joystick.h"
#include "SDL_graphics.h"
#include
}
#include "Settings.h"
#include "Menu.h"
3) The Joystick and SDL_graphics libraries are C libs, whereas the Settings lib contains a C++ class, and so is not externed
4) For the main execution call, use the following:
CODE
extern "C" void XBoxStartup(){
5) Once you have your code written, compile (by pressing CTRL-F11)
6) Click Tools->CXBE to create the xbe file
7) Upload and test the file on your xbox
Final ThoughtsThis setup has worked just fine for me. I do not claim to be a C++ guru, but from my basic assembly classes, as I recall, extern tells the linker to look outside of the current file for the symbol, and you can specify whether to connect to a C or C++ lib in this manner.
I hope this helps everyone out there. If this doesn't work for you, I will be very soon
releasing an opensource app which utilizes C and C++ classes, so wait just a bit longer, and you will have the entire source to look into.
Working MakefileCODE
# Project: Cher
# Makefile created by Dev-C++ 4.9.9.2
CPP = i386-pc-xbox-g++
CC = i386-pc-xbox-gcc
WINDRES = i386-pc-xbox-windres
RES = Cher_private.res
OBJ = Joystick.o SDL_graphics.o Settings.o Error.o Cher.o Menu.o $(RES)
LINKOBJ = Joystick.o SDL_graphics.o Settings.o Error.o Cher.o Menu.o $(RES)
LIBS = -L"C:/cygwin/usr/local/openxdk/i386-pc-xbox/lib" -L"C:/cygwin/usr/local/openxdk/lib" -nostdlib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20 -shared -Wl,--entry,_WinMainCRTStartup -Wl,--strip-all -lstdc++ -lSDL -lopenxdk -lhal -lc -lhal -lusb -lc -lxboxkrnl -mwindows
INCS = -I"C:/cygwin/usr/local/openxdk/i386-pc-xbox/include" -I"C:/cygwin/usr/local/openxdk/include" -I"C:/cygwin/usr/local/openxdk/include/SDL"
CXXINCS = -I"C:/cygwin/usr/local/openxdk/i386-pc-xbox/include" -I"C:/cygwin/usr/local/openxdk/include" -I"C:/cygwin/usr/local/openxdk/include/SDL"
BIN = Cher.exe
CXXFLAGS = $(CXXINCS) -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM -w
CFLAGS = $(INCS) -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM -w
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before Cher.exe all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o "Cher.exe" $(LIBS)
Joystick.o: Joystick.c
$(CC) -c Joystick.c -o Joystick.o $(CFLAGS)
SDL_graphics.o: SDL_graphics.c
$(CC) -c SDL_graphics.c -o SDL_graphics.o $(CFLAGS)
Settings.o: Settings.cpp
$(CC) -c Settings.cpp -o Settings.o $(CFLAGS)
Error.o: Error.c
$(CC) -c Error.c -o Error.o $(CFLAGS)
Cher.o: Cher.cpp
$(CC) -c Cher.cpp -o Cher.o $(CFLAGS)
Menu.o: Menu.cpp
$(CC) -c Menu.cpp -o Menu.o $(CFLAGS)
Cher_private.res: Cher_private.rc
$(WINDRES) -i Cher_private.rc --input-format=rc -o Cher_private.res -O coff