gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > GCC with MS Studio

#6573 - shoaib - Thu May 29, 2003 2:10 pm

Can any one help me out on how to set up MS Studio with GCC?
I mean using the project feature etc. ?

#6574 - niltsair - Thu May 29, 2003 2:25 pm

There's a small utility that'll create a new type of project under VisualC++.

Check it under www.gbadev.org in the Tools->Misc Section. It's GBA App Wizard.

Of course, in order for this to work, you have to install DevKitAdv. I believe there might be some path to define, for includes, bins, libs.

#6666 - Lupin - Sun Jun 01, 2003 1:37 pm

but I don't think that it's that good, because I don't see any way to use Sin and Cos operations with that Wizard :/

It doesn't also display the code errors in Visual Studio...

#6672 - tepples - Sun Jun 01, 2003 6:30 pm

Lupin wrote:
but I don't think that it's that good, because I don't see any way to use Sin and Cos operations with that Wizard :/

To use sin() and cos(), make sure you #include <math.h> and add -lm in your link command line to bring in libm. Because the ARM7TDMI in the GBA does not have a floating-point execution unit, floating-point operations such as sin() and cos() are better done with lookup tables than with libm. You'll get more efficient code, and more efficient code drains the battery less.

Quote:
It doesn't also display the code errors in Visual Studio...

There's a patch for GCC that makes it print its error messages in a format that Microsoft Visual Studio understands.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#6909 - Lupin - Wed Jun 04, 2003 2:02 pm

Cool, is there an tutorial wich shows how to use GCC with VS? I already saw some tuts, but they didn't show how to get it work with debug output :(

#6910 - Lupin - Wed Jun 04, 2003 2:07 pm

... but it didn't work :(

This is my batch file I used for compile:
path=C:\devkitadv\bin
gcc -o test.elf tutor1.c dma.c -lm -g
objcopy -O binary test.elf test.bin
pause

and this is the C code:

#include <math.h>

(...)

float TestFlt = 0;
TestFlt = Sin(6.0f);

#6935 - tepples - Wed Jun 04, 2003 7:04 pm

Use sin() and cos(), not Sin() and Cos(). C is case sensitive.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#6979 - Lupin - Thu Jun 05, 2003 6:50 pm

ok, that solves my problem :o)

What about the debug output?