How To Build a Compile Environment in Windows??
Posted: Sun Jun 06, 2004 10:08 am
Recently,I want to build a compile Environment in Windows using Cygwin.But Some problems occur when I write a simple c program.Follow is my program:
int main()
{
}
gcc -c test.c
ld -o test -Ttext 0x0 -e main test.o
error : Undefine reference '_alloca' and '_main'
Then follow some guide,I change the program as follow:
int Init()
{
}
gcc -c test.c
ld -o test -Ttext 0x0 -e _Init test.o
objcopy -R .note -R .comment -S -O binary test test.bin
No error occurs.but when I view the bin files,I discover that there are 4k byte 0 added.Are there added by the Window System or not??How to delete them when compiling.
int main()
{
}
gcc -c test.c
ld -o test -Ttext 0x0 -e main test.o
error : Undefine reference '_alloca' and '_main'
Then follow some guide,I change the program as follow:
int Init()
{
}
gcc -c test.c
ld -o test -Ttext 0x0 -e _Init test.o
objcopy -R .note -R .comment -S -O binary test test.bin
No error occurs.but when I view the bin files,I discover that there are 4k byte 0 added.Are there added by the Window System or not??How to delete them when compiling.