Home | Forums | What's new | Resources | |
Anyone using HEW ??? |
shinhoshi - Sep 24, 2003 |
1 | 2 | Next> |
vreuzon | Sep 26, 2003 | |||
Does it eventualy compile ? |
shinhoshi | Sep 26, 2003 | |||
Yes, there are no compiler errors. It's the SEGA2D_1 demo in the sample2 dir. Here are a couple of screenshots of what I initially did: |
antime | Sep 26, 2003 | |||
I'm guessing you're using the wrong linkscript and startup file. |
shinhoshi | Sep 26, 2003 | ||||
What ? I don't understand what are you refering to... |
antime | Sep 26, 2003 | |||
A linkscript... is a set of instructions that tells the linker how the program should be laid out. The startup file... contains code that runs before your program, setting up the environment, and after it, cleaning up. If you don't specify a script and startup file you'll use the GCC default ones, which will be wrong for SGL and the Saturn in general. One set of script/startup files can be found in the "sample\common" directory in the SGL tree. |
shinhoshi | Sep 26, 2003 | |||||||
I am not really very used to GCC... In the linker options there is an option called command file in what I think that's where I am supposed to put the script/startup file. However, HEW says me this:
Code:
There is no space in the name of the script/startup file since it's "makefile". I've modified it to what I think it's the correct way:
Code:
|
antime | Sep 26, 2003 | |||||||
By your earlier posts I guess you've put all files under
Code:
I'm not sure what you mean by the rest of your post. You need the linkscript and startup file, not the makefile (which is for building the startup file). |
shinhoshi | Sep 26, 2003 | ||||
Tosh...I see. I thought that HEW had no problem with standard path names... Now I understand the problem of the space.
Me neither. It's the first time in my life that I heard about linkscript and startup files. As I told you, I am not very used to GCC. I usually code using Visual 6.0, where you only need to specify the path for include/libs and it makes all the dirty job for you. |
shinhoshi | Sep 26, 2003 | |||
I've finally understood what's the startup file and what's the linkscript. However, how do I add the linkscript to the linker commands ? |
antime | Sep 26, 2003 | |||
There's probably something under the project settings. Was there no documentation included with the IDE package? |
shinhoshi | Sep 26, 2003 | ||||
I have been unable to find it. There is however a text box where you can add options directly. What would be the command to specify manually the linkscript file ? I used -xLinker but this appeared:
|
shinhoshi | Sep 26, 2003 | ||||
I was doing it wrong. I had to put the linkscript file in the Command file options instead the startup file. Now that I have done it correctly (or at least that's what I think). I have returned to the first error I've had at the beginning.
Code:
|
antime | Sep 26, 2003 | |||||||||||||
Going to the... source... is usually quite instructive.
"-Tlinkscript". On the compiler command line this should work: "-Xlinker -Tlinkscript". If it doesn't, try "-Xlinker -T -Xlinker linkscript".
Yes, well, passing object files as scripts is not expected to work. Anyway, the error messages you get now show that the startup files and linkscript are set up OK (the ___Start symbol in the linkscript should probably be changed to ___start, though, but the default should work fine). Now it's complaining that it can't find the SGL functions, which means you haven't added the libraries to your project. |
shinhoshi | Sep 26, 2003 | |||
Thanks antime for the help. However, the libraries (directories+files) are added. This is the same problem I had in the beginning. |
antime | Sep 26, 2003 | |||||||
Not correctly, they're not. Otherwise the linker wouldn't complain about not being able to find the functions provided in the libraries, see?
No it's not. The first problem you had was that the linker couldn't find a function called "main". This function is provided in the SGL startup file. Now it's complaining that it can't find the functions "slInitSystem", "slTVOff", "slLocate" and "slPrint". As you can see from the error message, these functions are called from "ss_main", which is your code. From the error messages you can also see what the link script did. Originally the start address defaulted to 0x00001000, which on a Saturn would be somewhere in the BIOS ROM. Now it's putting the start at 0x06004000, which is near the start of workram-high, after the stacks and vector tables. |
shinhoshi | Sep 26, 2003 | |||
I had the same problem at the beginning. This "main error" problem was when I added manually all the .a and .o files from the SGL/LIB directory. The normal thing after seeing the "build lines" would be to think that the lib dir is incorrectly added, but it isn't. I have even added it to the command line(on HEW) by writing -Ldir and the same problem appears. I've also thought it was a problem of spaces in name again, but even writing them using ~, the same problem happens. |
antime | Sep 26, 2003 | |||
Try changing the linking order, IIRC it should be startup file, libraries, your code. |
shinhoshi | Sep 26, 2003 | |||
Yes, I have also thought that but: 1. Even if I put the SGL directory the first, the same happens. 2. Even if I don't call any startup file, the same happens. 3. The code compiles right using a makefile, it's the SEGA2D_1 example. This is very strange. It has to be a stupid thing for sure, but right now I am incapable of finding it. I think I will uninstall HEW and use the standard method, like all the others. |
antime | Sep 26, 2003 | |||
The order any directories are listed makes no difference, you have to list the libraries you want to link before your own code. It may be necessary to use the -nostartfiles compiler directive since you're using a custom one (and if you don't use it, your code will never be called). |
1 | 2 | Next> |