forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Windows GCC Help Needed

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Ibanez_NZ
Guest





PostPosted: Fri Feb 20, 2004 7:16 am    Post subject: Windows GCC Help Needed Reply with quote

Hi! New to the PS2 dev scene and need some help...

Ideally would like to be able to get the Windows PS2 Development Environment up and running properly. I already tried the whole cygwin/binutils/patches/gcc-ee/gcc-iop thing, but got lost amongst all the makes/configs/patches etc. and didn't come close to building a working compiler; I then did a bit of assembly coding using a (homemade) R5900 assembler, but ran into a dead end beyond simple 2d bitmaps. So that brings me back to gcc.

I downloaded said 'Windows PS2 Development Environment' (you know- the one with everything all pre-compiled and ready to go? Just what I was looking for!), got at installed, etc. great. Having trouble though getting anything to compile (even 'void main(void) {}'). I copied over crt0.s and crt0.o and not get errors reading...

crt0.o: In function '_start':
crt0.s:48: Undefined reference to '_stack'
crt0.s:48: Undefined reference to '_stack'
crt0.s:49: Undefined reference to '_stack_size'
crt0.s:49: Undefined reference to '_stack_size'
crt0.s:60: Undefined reference to '_heap_size'
crt0.s:60: Undefined reference to '_heap_size'
collect2: ld returned 1 exit status

This is when I use 'ee-gcc main.c' on my 'int main(void) {}' program. Anyone got any idea on what I'm doing wrong? Really keen to get into this- been trying for weeks and it's really driving me crazy!!!!

Thanks guys any help would be GREATLY appreciated!!!!
Back to top
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Feb 20, 2004 7:56 am    Post subject: Reply with quote

Sounds like you're not telling gcc where to find the linkfile. Do this by adding:

-T$(PS2LIB)/ee/startup/linkfile
Back to top
View user's profile Send private message Visit poster's website
Ibanez_NZ
Guest





PostPosted: Fri Feb 20, 2004 8:15 am    Post subject: Thank you!!! Reply with quote

Oopo, you are a freaking genius!!!! That seemed to have done the trick (with a minor adjustment). I am forever in your debt! Can't wait to get into some real coding action- just have to brush up on my C skills now (obviously it's been a while :) )

Thanks again for the quick rely!
Back to top
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Fri Feb 20, 2004 8:21 am    Post subject: Reply with quote

has the first canadian genius been spotted ?
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Ibanez_NZ
Guest





PostPosted: Fri Feb 20, 2004 8:28 am    Post subject: Canadian Genius Reply with quote

Allen, John F.: Physicist. co-discoverer of superfluidity
Altman, Sidney: 1989 Nobel Prize winner in chemistry.
Banting, Frederick: 1923 Nobel Prize winner in medicine. co-discoverer of insulin
Brockhouse, Bertram: 1994 Nobel Prize winner in physics.
Best, Charles: co-discoverer of insulin with Banting
Giauque, William Francis: 1949 Nobel Prize Winner in Chemistry
Gosling, James: Programmer. inventor of Java
Herzberg, Gerhard: 1971 Nobel Prize winner in chemistry
Hubel, David: 1981 Nobel Prize winner in medicine
Marcus, Rudolph: 1992 Nobel Prize winner in Chemisty
Osler, Sir William: Physician. "most influential physician in history"
Penfield, Wilder: Neurosurgeon. discovered electrical stimulation of the brain
Polanyi, John: 1986 Nobel Prize winner in chemistry
Schawlow, Arthur: 1981 Nobel Prize winner in physics (for lasers)
Scholes, Myron: 1997 Nobel Prize winner in Economics
Smith, Michael: 1993 Nobel Prize winner in chemistry
Taube, Henry: 1983 Nobel Prize winner in chemistry
Taylor, Richard: 1990 Nobel Prize winner in physics
Vickrey, William: 1996 Nobel Prize winner in economics
Wilson, Tuzo: Geophysicist. plate tectonics

And now....

Oopo: PS2 Dev master. Winner of Ibanez's "Best guy ever"
Back to top
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Fri Feb 20, 2004 8:56 am    Post subject: Reply with quote

Hahaha :) a good rebuttal indeed. 10 bmx ninja points awarded
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Feb 20, 2004 11:42 am    Post subject: Reply with quote

Excellent job of teaching the king of vu a few facts about the most wonderful of countries... Canada.

I missed it the first time... did you say homemade r5900 assembler? And you got confused with building a toolchain? Wow. :)
Back to top
View user's profile Send private message Visit poster's website
Ibanez_NZ
Guest





PostPosted: Fri Feb 20, 2004 12:42 pm    Post subject: Reply with quote

Yeah, got a good list of the opcodes and was pretty simple (compared to making a CISC assembler anyway!)- used Delphi to start to make an IDE with it, but gave it up. Hope to get into the demo scene once I get going; been coding demos since the old C64/Amiga days and done some DirectX games, so plenty of C/assembly experience, but definitely not a *nix guru, so am *not* liking GCC and the whole toolchain rubbish! (am looking at the gcc.gnu.org page now to learn how to use it).

blackdroid: Can I cash in my bmx ninja points for dumb questions?
Back to top
Ibanez_NZ
Guest





PostPosted: Sat Feb 21, 2004 6:47 am    Post subject: Stuck again Reply with quote

Ok blackdroid, lets see if there are any Swedish geniuses... I got the 'hello world' sample program working with ps2lib (I didn't know you could just type 'make' doh!). But having trouble with the 'starsim' demo (the real simple one by Sjeep- hey a fellow kiwi!)- cant seem to be able to call the functions in hw.s. Even adding a DmaReset() line in the hello world program says

Undefined reference to 'DmaReset'

(I do have "#include "hw.h" in my source). I am completely baffled, no doubt it is something trivial, but I am stumped- very frustrating because the code part is easy- just compiling is the hard part!!!

Ok so 100 bmz ninja points to anyone who can help out a fellow code monkey here :)
Back to top
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Sat Feb 21, 2004 8:41 am    Post subject: Reply with quote

Undefined reference is during linking stage.. you dont provide the object file wich contains the functions and gcc says it cant find them by saying "Undefined reference"..
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Ibanez_NZ
Guest





PostPosted: Sat Feb 21, 2004 9:33 am    Post subject: Reply with quote

Yeah got that much figured out, just trying to work out how to feed gcc the hw.s file with my hello.c- I tried using the 'as' command, but the register values aren't defined, I guess I could put those definitions in, but surely there must be an easier way (there should be a gcc switch or a line in my makefile perhaps?)
Back to top
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Sat Feb 21, 2004 11:00 am    Post subject: Reply with quote

hw.s should have been compiled to an object file
ee-gcc -o hw.o hw.s
and then when linking hw.o should be given..
ee-gcc -o starsim starsim.o hw.o ( or some like that )
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Ibanez_NZ
Guest





PostPosted: Sat Feb 21, 2004 12:23 pm    Post subject: Reply with quote

Well, well, looks like the first Swedish genius has been spotted, disregarding a few insignificants (Nobel, Swedenborg, et. al).

With a bit of tinkering got it working...

ee-gcc -c hw.s

once I removed crt0.o from the directory (don't know why, but google told me and it worked..)

Nothing can stop me now!!!!!!! (hmmm we'll see!)
Back to top
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Feb 21, 2004 3:12 pm    Post subject: Reply with quote

Er .. whether or not the Canadian and Swede are geniuses or not, every question you've asked thus far is presented in those nice little files we call Makefiles :).

Study GNU make and the Makefiles within ps2lib, it'll save you a lot of time.
Back to top
View user's profile Send private message
Ibanez_NZ
Guest





PostPosted: Sat Feb 21, 2004 5:06 pm    Post subject: Reply with quote

Might seem obvious to you vets, big mental leap to someone who hasn't used GCC before. Well and truly got the whole 'make' and 'makfile' thing sussed now, so no more newbie questions I promise.
Back to top
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Sat Feb 21, 2004 8:39 pm    Post subject: Reply with quote

Ibanez_NZ wrote:
so no more newbie questions I promise.


right ;)
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Ibanez_NZ
Guest





PostPosted: Sun Feb 22, 2004 6:00 am    Post subject: Reply with quote

Haha- have a little faith blackdroid! :) Make good progress on my own graphics library already, popping polygons all over the place now, will do some 3d maths functions today (can almost do this blindfolded now- been doing this since the early 80s!). The only problem is that the PS2 ethenet cables are not out in New Zealand yet (expected in March), so I have to do my testing on an emulator, which running on a 500Mhz P3 is sloooooow :P
Back to top
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Sun Feb 22, 2004 8:53 am    Post subject: Reply with quote

google for an online store that sells sony ethernet adapter. they exist :)
also a piece of advice, dont do vu code with the emu, they dont seem to emulate vu floats properly.
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group