xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> Source Code Help
Pulsemasta
post Jan 9 2010, 10:51 AM
Post #1


X-S Expert
***

Group: Members
Posts: 725
Joined: 29-November 08
Member No.: 397380
Xbox Version: v1.1
360 version: unknown



Can someone tell me how exactly you compile source code into a working program? Say for instance I have the source code for Beats of Rage.... I open it up in Visual Studio and press "build", hundreds of compile errors come up.... shouldn't the source from xbins be the final product with no errors? Also does this have anything to do with the games media content (of which I couldn't find any)? Does the Xbox render the game entirely from code??

any help would be appreciated.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
obcd
post Jan 9 2010, 11:21 AM
Post #2


X-S Hacker
******

Group: Moderator
Posts: 2737
Joined: 5-April 07
Member No.: 337188
Xbox Version: v1.0
360 version: none



Build is a 2 step thing.
In step 1, the source code c and c++ files will be compiled to object files. Most errors that appear are missing header files. In visual studio 2003 under the option tab, you have to tell the ide where it should search for include files. If the path setting isn't there, it will not find the include file. If you install your sources in a different folder, the include files will also exist in a different folder. I am even unsure that the include path settings are stored in the project file. I think they are global for the ide.

In step 2, the object files generated in step one are linked together.
They are also linked to a number of libraries. libraries are files that contain usable functions.
Those functions are usually defined in the header files.
Again, the ide needs to know where to search for the libraries.
If a library is missing, you will get a number of unresolved external errors.
This is due to library function calls in the code. If the function doesn't exist, the linker can't resolve the function call.

It's usually a good practice to install the existing version of your program (emulator) first. That way, you will be sure to have the correct artwork and font files for your program to run. Sometimes a downloaded source package only contains the source files to create the main xbe, and the artwork is not included as it usually hardly changes.

In case of the xbox, most programs are created using the xdk. This means that the code cam functions from the xdk library. There are several versions of that library, and some function calls can be missing in older xdk library versions. In that case, you will get an unresolved external as well during linking.

So basically, it's best to start with one C file at a time and just compile it instead of starting the full build. If it compiles without errors, you can jump to the next file. It's not possible to rush things, it simply won't work.

When all C code compiles, you can start the linking.

In the beginning, the number of errors will decrease fast. The last ones appearing are the most difficult.

Good Luck.


User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Pulsemasta
post Jan 9 2010, 12:38 PM
Post #3


X-S Expert
***

Group: Members
Posts: 725
Joined: 29-November 08
Member No.: 397380
Xbox Version: v1.1
360 version: unknown



QUOTE(obcd @ Jan 9 2010, 11:21 AM) *

Build is a 2 step thing.
In step 1, the source code c and c++ files will be compiled to object files. Most errors that appear are missing header files. In visual studio 2003 under the option tab, you have to tell the ide where it should search for include files. If the path setting isn't there, it will not find the include file. If you install your sources in a different folder, the include files will also exist in a different folder. I am even unsure that the include path settings are stored in the project file. I think they are global for the ide.

In step 2, the object files generated in step one are linked together.
They are also linked to a number of libraries. libraries are files that contain usable functions.
Those functions are usually defined in the header files.
Again, the ide needs to know where to search for the libraries.
If a library is missing, you will get a number of unresolved external errors.
This is due to library function calls in the code. If the function doesn't exist, the linker can't resolve the function call.

It's usually a good practice to install the existing version of your program (emulator) first. That way, you will be sure to have the correct artwork and font files for your program to run. Sometimes a downloaded source package only contains the source files to create the main xbe, and the artwork is not included as it usually hardly changes.

In case of the xbox, most programs are created using the xdk. This means that the code cam functions from the xdk library. There are several versions of that library, and some function calls can be missing in older xdk library versions. In that case, you will get an unresolved external as well during linking.

So basically, it's best to start with one C file at a time and just compile it instead of starting the full build. If it compiles without errors, you can jump to the next file. It's not possible to rush things, it simply won't work.

When all C code compiles, you can start the linking.

In the beginning, the number of errors will decrease fast. The last ones appearing are the most difficult.

Good Luck.



Thanks for the reply!

I will have to play around with it more, keeping your tips in mind.

Just to clarify, once I get the code to compile with 0 errors I should be able to take the XBE and put it in the file with the media files and the program should run?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
obcd
post Jan 9 2010, 09:24 PM
Post #4


X-S Hacker
******

Group: Moderator
Posts: 2737
Joined: 5-April 07
Member No.: 337188
Xbox Version: v1.0
360 version: none



Yes, if you replace the default.xbe in the package with the one you just compiled, it should run on the xbox.

If you have a dual retail / debug bios, you can use the debug dash to test things out.
Visual Studio 2003 transfers the file over the network to the xbox and launches it there.
You can even set a breakpoint in the sources.
If the code execution arrives at the breakpoint, it will stop it's execution so that you can examine your variables. You develop much faster that way.

PS. You can only use it if you can use the xdk together with Visual Studio.

regards.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 23rd May 2013 - 06:03 AM