It would be very cool if someone would post a (noob-proof) step by step tutorial and a download with a little code sample(preferably some very simple SDL examples) including all corresponding/appropriate project files.
Okay,so here's my problem:
I've started a win32 project > console application > empty project (I'm using the latest VS.net)
Code Generation : Single Threaded
All includes and libraries are properly set up in the options.
I've already fixed the 'typedef int bool' bug in types.h
Oh,and i'm using OpenXDK 0.06 (i hope this ain't the problem)..
My code :
CODE
#pragma comment(lib, "libhal.a")
#pragma comment(lib, "libopenxdk.a")
#pragma comment(lib, "libSDL.a")
#pragma comment(lib, "libSDL.la")
#pragma comment(lib, "libSDLmain.a")
#pragma comment(lib, "libusb.a")
#pragma comment(lib, "libxboxkrnl.a")
#pragma comment(lib, "crt0.o")
#pragma comment(lib, "libc.a")
#pragma comment(lib, "libg.a")
#pragma comment(lib, "libm.a")
#pragma comment(lib, "libnosys.a")
#include
void XBoxStartup()
{
HalReturnToFirmware(ReturnFirmwareFatal);
return;
}
Compiling this sample gives me this error:
CODE
OXDK_TEST error LNK2019: Nicht aufgelöstes externes Symbol '_main', verwiesen in Funktion '_mainCRTStartup'
OXDK_TEST fatal error LNK1120: 1 unaufgelöste externe Verweise
in english : unresolved external symbol in function and 1 unresolved external reference(XBoxStartup?)
So how can i fix this ?
Any help would be greatly appreciated.
QUOTE(TNHitokiri @ Dec 24 2004, 07:44 PM)
Is there a way to make this work with Visual Studio .Net ?
aww ..... i cant upload .... hey hornydevil can i be a a leader here?
he just said yes it will work with .NET
My question:
Can I compile .XBE's with just my PC alone or do I need that second tool?
allright u shaddy obisities, here ya go
how to compile xbe with .net
--------------------------------------------------------------------
OpenXDK - MS Visual Studio .NET - Installation Instructions
--------------------------------------------------------------------
This document describes the process which should be used if you
wish to develop "homebrew" software for the XBox using OpenXDK.
Information is as precise and correct as I can make it, but feel
free to submit suggestions. After all, OpenXDK is an open source
project, and our success relies on community contributions.
------------------------------------------------------------------
Table of Contents
------------------------------------------------------------------
1) Installation
a) Download
Unzip
c) Build
2) Development
a) Creating a New Project
Removing "Debug" Configuration
c) Setting Compiler and Linker Options
d) Setting Required Directories
e) Configuring CXBE for Custom Build
f) Adding XBoxStartup
g) Building Your Project
------------------------------------------------------------------
Information
------------------------------------------------------------------
1) Installation
a) Download
To download the latest OpenXDK files, go to the OpenXDK web site
displayed below, and locate the appropriate download file(s).
http://openxdk.sourceforge.net/
Hint: You want "OpenXDK" and perhaps one of the Samples.
Unzip
OpenXDK is distributed in .zip format. After downloading OpenXDK,
the next step is to decompress the .zip file into a directory of
your choice. The preferred directory is C:\OpenXDK, but you may
put these files wherever you wish. The only requirment is that
you must remember where this directory is.
c) Build
Building OpenXDK is very easy. The decompressed folder (C:\OpenXDK)
contains a file called OpenXDK.sln. To build OpenXDK, simply open
this workspace with MS Visual Studio .NET, and then build the
projects.
Note: To build, click Build->Build Solution.
2) Development
a) Creating a New Project
There are some specific steps that must be taken when creating a
project for use with OpenXDK. Primarily, Compiler and Linker options
must be tweaked, and 3 directories must be added to the compiler's
search path. The details on how to configure these options are
explained in detail below.
The first step is to create a new project. This can be done by
opening MS Visual Studio .NET and creating a new Win32
project and workspace. This can be done via File->New->Project.
The type of project you will want to create is "Win32 Project".
It does not matter where you put your project files, as we will add
the necessary directories for includes, lib, and binaries later
in this tutorial.
After you click OK, you will be asked what type of windows
application you would like to create. You should click on the tab
marked "Application Settings", and make sure "Windows Application"
in chosen, then check the box next to "Empty Project". Then, click
"Finish".
Now that you have a new project, you will need to modify a few of
the default options before your .exe will relink correctly. The
exact options that need to be changed are described next.
Removing "Debug" Configuration
Since you can not use "Debug" configuration with OpenXDK, it is
recommended that you remove this configuration completely. To do
this, use the menu Build->Configuration Manager, and in the drop
down boxed titled "Active Solution Configuration", choose "<Edit...>"
In the window that comes up, select "Debug", and push "Remove".
Then click Yes on the confirmation dialog that comes up next. Once
this is done you can close the "Edit Solution Configurations" dialog,
and the "Configurations Manager" dialog.
c) Setting Compiler and Linker Options.
Compiler options are accessed through the menu Project->Properties.
The first set of options we are concerned about are located under
the "C/C++" folder. First, switch to the category titled "Code Generation"
and set "Enable C++ Exceptions" to "no". Then, set "Buffer Security ChecK"
to "no". Optionally, you might want to go to the category marked
"Optimization" and switch "Optimize for Processor" to "Pentium Pro and Above".
The next set of options we need to change are located under the
"Linker" folder. Switch to the category titled "Input". You will need
to set the box marked "Ignore All Default Libraries" to "Yes". Then,
under "Additional Dependencies", you should paste the following:
xboxkrnl.lib xlibc.lib xhal.lib xvga.lib
Next, you will need to add a few linker options by switching to the
category titled "Command Line" and typing directly into the box marked
"Additional Options". Add the following text to the very end of the
existing text:
/align:0x20 /driver /fixed:no
Failure to do this correctly will result in linker errors, and you
will not be able to compile your .xbe correctly. You can copy and
paste the text exactly as it is above, but you must be absolutely
certain to paste the text at the very end of the text in the box.
After you have added these settings, just click "OK".
d) Setting Required Directories
In order for your code to compile and link correctly, you will need
to add a few paths to your configuration. To add these directories,
you can use the menu Tools->Options. Then, click over to the folder
named "Projects". Click on the category marked "VC++ Directories" and
add the following paths to the appropriate directory list. (You change
between directory lists using the drop down under "Show Directories for:"
"Include files" -> C:\OpenXDK\include\
"Library files" -> C:\OpenXDK\lib\
"Executable files" -> C:\OpenXDK\bin\
You must be sure to add these directories to the correct choice under
the drop down box titled "Show directories for:". Your paths may be
different, depending on where you chose to unzip the OpenXDK files.
After you have added these settings, just click "OK".
e) Configuring CXBE for Custom Build
Now, you must configure your project to use CXBE as a custom build step.
This is the process that is used to convert your .exe file to an .xbe
file that is compatible with the XBox. To configure this setting, you can
use the menu Project->Properties, then switch to "Custom Build Step".
Inside the box marked "Description", you can put whatever you like, but
I usually use the following text:
Relinking $(InputName).exe -> default.xbe
Inside the box marked "Command Line" you will need to use the following text:
cxbe -TITLE:"CXBX Demo" -OUT:"$(TargetDir)default.xbe" "$(TargetPath)"
You will probably want to replace the phrase "CXBX Demo" with the title
you want to use for your program.
Inside the box marked "Outputs" you will need to use the following text:
$(TargetDir)\default.xbe
After you have added these settings, just click "OK".
f) Adding XBoxStartup
The last requirement to complete your project configuration is to include
a valid entry point for your application. Typically, the below code is a
good place to start development from:
#include <openxdk.h>
void XBoxStartup()
{
HalReturnToFirmware(ReturnFirmwareFatal);
return;
}
Note: After you run the above code, your xbox will go to the "fatal" boot
screen. It is ok, nothing is harmed, it is simply a demonstration of what
OpenXDK can do. (Your Xbox will be back to normal after rebooting).
g) Building Your Project
If everything went well, you now have a valid project, and you can
immediately start developing. Try building your project containing
only the simple entry point as shown above, and if all goes well,
your build will succeed and the file "default.xbe" will be created.
You should be able to run this executable on a modded xbox.
bob1122 have fun reading . and someone let me edit my post
see bob this is why i disliked you posting this in the first place.
the above information is totally wrong, and will not work. All it does is gets peoples hopes up to use openxdk with visual studio and it won't work, and then they don't bother trying cygwin because they already tried and failed with visual studio. to begin with there is no .sln project file in openxdk anymore, hasn't been for a long time. Namely, it was gotten rid of when the openxdk moved from Visual Studio to gcc toolchains. Long since gone. Check the cvs. It ain't there.
your libraries are all wrong too.. we don't use the xlib* libs anymore (if ever, im unsure..)
In fact I'm pretty sure you cut and pasted this from somewhere else because quite simply I've never seen you make sentences this well, and most of it matches info from years ago.
QUOTE(d0wnlab @ Jan 28 2005, 04:50 AM)
In fact I'm pretty sure you cut and pasted this from somewhere else because quite simply I've never seen you make sentences this well
hahah nice d0wnlab
QUOTE(d0wnlab @ Jan 28 2005, 03:25 AM)
see bob this is why i disliked you posting this in the first place.
what are you a moderator
QUOTE(bob1122 @ Feb 5 2005, 03:29 AM)
what are you a moderator
QUOTE(fghjj @ Feb 5 2005, 06:34 PM)
No I think he isn't but if he was I'm sure no one would stop him from pointing this worthless "advice" to the garbage bin. Really, there's nothing wrong with helping people but you've been posting crap here in the "Development" forum ever since your first post...
well then how do i install it with visual studio .net 2003 professional?
Does anybody know how to get .NET versions of VS to use an alternate compiler executable?
If you do, I could modify my devcpp tutorial to make it work for VS.
I would be more than willing to create a tutorial if people are interested, once I figure out how to redirect the compiler.
QUOTE(edwardaux @ Jul 11 2005, 05:46 AM)
> Does anybody know how to get .NET versions of VS to use
The easiest way to build an openxdk app with vs (any version) is to create a makefile project.
I've done things this way on occasion and it's worked ok for me.
You'll need to add your paths (executables, includes etc) to the vs options.
CODE
--------------------Configuration: main - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
main.exe - 2 error(s), 0 warning(s)
now i know its the linker but what exactly do i put in there. if i can get this to work i will make a video on how to set it up for all.
can someone tell me what to put for like linker options and stuff. I added the directories but no luck same linker error so a pic of someones options would be great ( like there settings LInker and all)
You'll have a much easier time using dev-c++. There are two tutorials to set up your environment using this instead.
Cheers,
Tom
QUOTE(d0wnlab @ Oct 25 2005, 08:32 PM)
You'll have a much easier time using dev-c++. There are two tutorials to set up your environment using this instead.