Help - Search - Members - Calendar
Full Version: Compiling With Openxdk
Scenyx Entertainment Community > Xbox1 Forums > Software Forums > Development
SmashManiac
I'm just trying to compile the Samples_0.07 and it doesn't work at all.

Cygwin is installed in C:\cygwin\
OpenXDK is installed in R:\openxdk\
Samples are in R:\temp\Samples_0.07\

The only line I've changed from the makefile is:
QUOTE
PREFIX = /usr/bin/openxdk

to:
QUOTE
PREFIX = ~/openxdk

because Cygwin recognize ~ as my R:\.

I run the Cygwin Bash Shell and write:
QUOTE
cd ~/temp/Samples_0.07
make


And get as the output:
QUOTE
i386-pc-xbox-gcc -c comingSoon.c -c -g -std=gnu99 -ffreestanding -nostdlib -fno-
builtin -fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM
-I~/openxdk/i386-pc-xbox/include -I~/openxdk/include -I~/openxdk/include/SDL
make: i386-pc-xbox-gcc: Command not found
make: *** [comingSoon.o] Error 127


uhh.gif uhh.gif uhh.gif WTF??? Why isn't it working???

When this will be done, I'll write a tutorial to how to install and use OpenXDK because I didn't find any on the whole Net, but meanwhile I must get it done myself!!!
Carcharius
Looks like i386-pc-xbbox-gcc can't be found in your environment path.

Either add R:\\openxdk\\bin to your path.

Or

Edit the makefile so that the lines that read:

CC = i386-pc-xbox-gcc
CPP = i386-pc-xbox-g++
CXBE = cxbe

now read:

CC = $(PREFIX)/bin/i386-pc-xbox-gcc
CPP = $(PREFIX)/bin/i386-pc-xbox-g++
CXBE = $(PREFIX)/bin/cxbe
SmashManiac
QUOTE(Carcharius @ Jun 24 2005, 02:32 AM)
Looks like i386-pc-xbbox-gcc can't be found in your environment path.

Either add R:\\openxdk\\bin to your path.

Or

Edit the makefile so that the lines that read:

CC  = i386-pc-xbox-gcc
CPP  = i386-pc-xbox-g++
CXBE = cxbe

now read:

CC  = $(PREFIX)/bin/i386-pc-xbox-gcc
CPP  = $(PREFIX)/bin/i386-pc-xbox-g++
CXBE = $(PREFIX)/bin/cxbe
*



Second solution doesn't change anything.
For the path thing, I have no idea how to do it.
Smoko
Have you got the GCC and G++ for Cygwin, I didnt. So I got them and, now it works

biggrin.gif
SmashManiac
QUOTE(Smoko @ Jul 1 2005, 09:56 AM)
Have you got the GCC and G++ for Cygwin, I didnt. So I got them and, now it works

biggrin.gif
*



Good thinking, but I wrote this in my Cygwin Bash Shell:
QUOTE
$ ls /bin/g*
/bin/g++-2.exe        /bin/gifcolor.exe  /bin/gperf.exe
/bin/g++.exe          /bin/gifcomb.exe    /bin/gpg.exe
/bin/g77-2.exe        /bin/gifcompose    /bin/gpgsplit.exe
/bin/g77.exe          /bin/giffiltr.exe  /bin/gpgv.exe
/bin/gawk-3.1.4.exe  /bin/giffix.exe    /bin/gpidump.exe
/bin/gawk.exe        /bin/gifflip.exe    /bin/gprof.exe
$
/bin/gcc.exe          /bin/gifinter.exe  /bin/grace.exe
/bin/gccbug          /bin/gifinto.exe    /bin/gracebat.exe
/bin/gcj.exe          /bin/gifovly.exe    /bin/grep-changelog
/bin/gcjh.exe        /bin/gifpos.exe    /bin/grep.exe
$
/bin/gcov.exe        /bin/gifrsize.exe  /bin/grepjar.exe
/bin/gd2copypal.exe  /bin/gifspnge.exe  /bin/grn.exe
/bin/gd2togif.exe    /bin/giftext.exe    /bin/grodvi.exe
/bin/gd2topng.exe    /bin/giftogd2.exe  /bin/groff.exe
/bin/gdb.exe          /bin/gifwedge.exe  /bin/groffer
/bin/gdcmpgif.exe    /bin/gij.exe        /bin/grog
/bin/gdlib-config    /bin/glpuzzle.exe  /bin/grolbp.exe
/bin/gdparttopng.exe  /bin/glut32.dll    /bin/grolj4.exe
/bin/gdtopng.exe      /bin/gm.exe        /bin/grops.exe
/bin/gendiff          /bin/gnat.exe      /bin/grotty.exe
/bin/getafm          /bin/gnatbind.exe  /bin/groups
/bin/getclip.exe      /bin/gnatbl.exe    /bin/gs.exe
/bin/getfacl.exe      /bin/gnatchop.exe  /bin/gsbj
/bin/getopt.exe      /bin/gnatdll.exe    /bin/gsdj
/bin/gettext.exe      /bin/gnatfind.exe  /bin/gsdj500
/bin/gettext.sh      /bin/gnatkr.exe    /bin/gsftopk.exe
/bin/gettextize      /bin/gnatlink.exe  /bin/gsl-config
/bin/gftodvi.exe      /bin/gnatls.exe    /bin/gsl-histogram.exe
/bin/gftopk.exe      /bin/gnatmake.exe  /bin/gsl-randist.exe
/bin/gftype.exe      /bin/gnatname.exe  /bin/gslj
/bin/gif2epsn.exe    /bin/gnatprep.exe  /bin/gslp
/bin/gif2ps.exe      /bin/gnatpsta.exe  /bin/gsnd
/bin/gif2rgb.exe      /bin/gnatxref.exe  /bin/gtypist.exe
/bin/gif2tiff.exe    /bin/gnuattach      /bin/guile-config
/bin/gif2x11.exe      /bin/gnuclient.exe  /bin/guile-snarf
/bin/gifasm.exe      /bin/gnudoit        /bin/guile-tools
/bin/gifbg.exe        /bin/gnugo.exe      /bin/guile.exe
/bin/gifburst        /bin/gnuplot.exe    /bin/gunzip.exe
/bin/gifclip.exe      /bin/gpc-run        /bin/gzexe
/bin/gifclrmp.exe    /bin/gpc.exe        /bin/gzip.exe

/bin/glui-examples:
example1.exe  example3.exe  example5.exe
example2.exe  example4.exe  example6.exe


So as you can see, they're here. And I can execute gcc and g++ anyway, so that's not the problem.
Carcharius
QUOTE(SmashManiac @ Jul 2 2005, 07:37 PM)
I can execute gcc and g++ anyway, so that's not the problem.
*


In that case - just edit the makefile and change it so thatg instead of trying to call i386-pc-xbox-gcc (or -g++) it just calls gcc (or g++).

The results will be the same - the i386-pc-xbox-* are just symlinks to the standard gcc, g++ etc. anyway
SmashManiac
QUOTE(Carcharius @ Jul 2 2005, 03:41 PM)
In that case - just edit the makefile and change it so thatg instead of trying to call i386-pc-xbox-gcc (or -g++) it just calls gcc (or g++).
*



Results are better this time. smile.gif

Still trying to compile the 0.07 samples. I've only changed the header of my makefile to this:
CODE
#
# update this variable to wherever you installed the OpenXDK libraries
#
#PREFIX = /usr/local/openxdk
PREFIX = ~/openxdk

#CC   = i386-pc-xbox-gcc
#CPP  = i386-pc-xbox-g++
CC   = /bin/gcc
CPP  = /bin/g++
CXBE = cxbe


Now the output is:
CODE
$ make
/bin/gcc -c comingSoon.c -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin
-fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM   -I~/open
xdk/i386-pc-xbox/include -I~/openxdk/include -I~/openxdk/include/SDL
comingSoon.c:2:22: hal/xbox.h: No such file or directory
comingSoon.c:3:23: hal/video.h: No such file or directory
comingSoon.c:4:31: xboxkrnl/xboxkrnl.h: No such file or directory
comingSoon.c: In function `XBoxStartup':
comingSoon.c:8: warning: implicit declaration of function `XVideoGetFB'
comingSoon.c:31: warning: implicit declaration of function `XSleep'
comingSoon.c:32: warning: implicit declaration of function `XReboot'
make: *** [comingSoon.o] Error 1


Obviously, it seems that make.exe can't see anything in the openxdk sub-directories, which is probably why writing i386-pc-xbox-gcc wasn't working either. Seems like there's not much missing, but what?
Carcharius
try setting

PREFIX=/r/openxdk instead of what you are using already.
SmashManiac
QUOTE(Carcharius @ Jul 2 2005, 05:00 PM)
try setting

PREFIX=/r/openxdk instead of what you are using already.
*



No improvements. Obviously because the /r directory does not exist for Cygwin.
I've checked 3 times and the directory in which I installed Openxdk is really ~/openxdk in my Cygwin installation...
Carcharius
Right a quick google leads me to believe that setting

PREFIX=/cygdrive/r/openxdk

should be what you need.

The drives available to windows should get mapped in /cygdrive.
SmashManiac
QUOTE(Carcharius @ Jul 3 2005, 03:57 PM)
Right a quick google leads me to believe that setting

PREFIX=/cygdrive/r/openxdk

should be what you need.

The drives available to windows should get mapped in /cygdrive.
*



A----HA! I knew that God was a part of Google! laugh.gif Even writing ls -al in Cygwin root directory doesn't show this special directory!

Well, it shows that gcc and g++ weren't made for writing a ~ in its -I parameter.

From better to better:
CODE
$ make
/bin/gcc -c comingSoon.c -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin
-fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM   -I/cygdr
ive/r/openxdk/i386-pc-xbox/include -I/cygdrive/r/openxdk/include -I/cygdrive/r/o
penxdk/include/SDL
/bin/gcc -o comingSoon.exe comingSoon.o -L/cygdrive/r/openxdk/i386-pc-xbox/lib -
L/cygdrive/r/openxdk/lib  -lSDL -lopenxdk -lhal -lc -lhal -lusb -lc -lxboxkrnl -
nostdlib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20  -shared -Wl,--e
ntry,_WinMainCRTStartup  -Wl,--strip-all
cxbe -TITLE:'comingSoon.exe' -DUMPINFO:"comingSoon.cxbe" -OUT:"comingSoon.xbe" c
omingSoon.exe > /dev/null
cxbe: not found
make: *** [comingSoon.exe] Error 127


... It can't find cxbe? No prob' with this type of error now! Just change my makefile header to this:
CODE
#
# update this variable to wherever you installed the OpenXDK libraries
#
#PREFIX = /usr/local/openxdk
PREFIX = /cygdrive/r/openxdk

#CC   = i386-pc-xbox-gcc
#CPP  = i386-pc-xbox-g++
#CXBE = cxbe
CC   = gcc
CPP  = g++
CXBE = /cygdrive/r/openxdk/bin/cxbe


And try again:
CODE
$ make
gcc -c comingSoon.c -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-
exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM   -I/cygdrive/r
/openxdk/i386-pc-xbox/include -I/cygdrive/r/openxdk/include -I/cygdrive/r/openxd
k/include/SDL
gcc -o comingSoon.exe comingSoon.o -L/cygdrive/r/openxdk/i386-pc-xbox/lib -L/cyg
drive/r/openxdk/lib  -lSDL -lopenxdk -lhal -lc -lhal -lusb -lc -lxboxkrnl -nostd
lib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20  -shared -Wl,--entry,
_WinMainCRTStartup  -Wl,--strip-all
/cygdrive/r/openxdk/bin/cxbe -TITLE:'comingSoon.exe' -DUMPINFO:"comingSoon.cxbe"
-OUT:"comingSoon.xbe" comingSoon.exe > /dev/null

Bam! Message box appears from cxbe.exe with message "The procedure entry point _impure_ptr could not be located in the dynamic link library cygwin1.dll."! OK. And finally Cygwin writes:
CODE
make: *** [comingSoon.exe] Error 57


After searching a bit in Google about _impure_ptr, I found out that this error occurs in old versions of Cygwin. So I must reinstall my Cygwin package... and I don't have the admin rights to do so!!!
grr.gif grr.gif grr.gif

At least, it looks like all of my problems with my makefile are OK now with those changes. cool.gif I must call the admin and let him solve the _impure_ptr problem. I don't know how long it will take, since it's in my university, but I'll write back when it'll be done.

Meanwhile, thanks for all your help Carcharius! beerchug.gif
Alistair23
Where is the GCC and G++ for Cygwin? I can't find it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.