LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2006, 09:53 PM   #1
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,267

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
openxdk compiling problems


hi, i am trying to get this to compile:
Code:
#include <openxdk/openxdk.h>
#include <stdio.h>
#include <stdlib.h>

void XBoxStartup()
{
            char buffer[300]; // large temp text buffer
            sprintf(buffer,"hello-schneidz");
            vga_print(50, 50, buffer);
}
but i get more than 100 compiling errors from this using gcc in redhat 9.
Code:
[schneidz@hyper-nmv1so2wb hello-world]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

[schneidz@hyper-nmv1so2wb hello-world]$ gcc hello-world.c -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -march=i386 -I/usr/local/openxdk/i386-pc-xbox/include -I/usr/local/openxdk/include
In file included from /usr/local/openxdk/include/xboxkrnl/xboxkrnl.h:71,
                 from /usr/local/openxdk/include/openxdk/openxdk.h:4,
                 from hello-world.c:2:
/usr/local/openxdk/include/xboxkrnl/dbg.h:17: warning: return type defaults to `int'
/usr/local/openxdk/include/xboxkrnl/dbg.h: In function `__declspec':
/usr/local/openxdk/include/xboxkrnl/dbg.h:18: parse error before "__declspec"
/usr/local/openxdk/include/xboxkrnl/dbg.h:17: warning: type of `dllimport' defaults to `int'
/usr/local/openxdk/include/xboxkrnl/dbg.h:17: declaration for parameter `DbgBreakPoint' but no such parameter
In file included from /usr/local/openxdk/i386-pc-xbox/include/sys/reent.h:14,
                 from /usr/local/openxdk/i386-pc-xbox/include/stdio.h:45,
                 from hello-world.c:3:

...
i get "cc1: invalid option `no-cygwin'" when trying to compile with '-mno-cygwin'.

does anybody have any experience with openxdk?

thank you,
 
Old 03-01-2006, 09:05 AM   #2
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
you are using red hat linux to build this on?
Quote:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Then you don't need the -mno-cygwin option.

But your program will fail compile anyway, as this warning message is saying:
Quote:
/usr/local/openxdk/include/xboxkrnl/dbg.h:17: warning: return type defaults to `int'
It comes from this line:
Quote:
void XBoxStartup()
C, and C++ must have a main function, so this should rightly be called main.
the other issue with it is the VOID. That is not a supported type for a function, it actually must be INT.

Code:
#include <openxdk/openxdk.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char buffer[300]; // large temp text buffer
    sprintf(buffer,"hello-schneidz");
    vga_print(50, 50, buffer);

  return 0;
}
is a functional format. I don't have the opendxk package to test it on, nor an xbox.
 
Old 03-01-2006, 11:47 AM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,267

Original Poster
Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
thanks much jaqui,

i was pretty sure i didn't need '-mno-cygwin' because i wasn't using cygwin but the confirmation is nice.

i was trying to do a slimmed down version of this:
http://www.xbdev.net/openxdk/tutoria...orld/index.php

i think my first problem is that 'xvga.h' isn't in '/usr/local/openxdk/i386-pc-xbox/include' or '/usr/local/openxdk/include'
(maybe it's only windows - is there a linux alternative?)

according to the tutorials i read 'XBoxStartup()' is the entry point for the xbox to run code.

what you said makes sense so i'll try to cross-compile it as a windows .exe then try to translate it to a xbox .xbe.

for a poc (proof of concept), can anyone get their xbox to say 'hello-world'.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems Compiling Problems With GCC And C++ phnxbn Linux - Software 0 11-02-2004 06:49 PM
Compiling Problems Warmaster Mandriva 1 06-01-2004 06:55 AM
Problems installing amsn (TK compiling problems) JNewton Linux - Software 0 05-24-2004 01:07 PM
2.6.3 compiling problems blackmask Linux - Newbie 1 04-19-2004 10:21 AM
compiling problems cameronknives Linux - General 31 02-10-2002 10:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration