LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   openxdk compiling problems (https://www.linuxquestions.org/questions/programming-9/openxdk-compiling-problems-420182/)

schneidz 02-27-2006 08:53 PM

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,

Jaqui 03-01-2006 08:05 AM

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.

schneidz 03-01-2006 10:47 AM

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'.


All times are GMT -5. The time now is 02:34 AM.