Page 1 of 1

[SOLVED] GCC Problem

Posted: Sun Aug 14, 2011 5:29 am
by maakera
Hi,

I'm using DJGPP and i have an issue with the GCC compiler.
I was trying to compile an c file and it didn't work, no error line's or anything.
So i thought something was wrong with the c script, so i dumbed it down only to main function.
But it still didn't work.
Here's the command line:

Code: Select all

gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c -o main.o main.c
I didn't use any includes because i dumbed it down to the main function.
The compiler doesn't give me an error line or anything, it just doesn't create the file main.o

Thanks,
Maakera

Re: GCC Problem

Posted: Sun Aug 14, 2011 7:08 am
by xenos
Tere!

Could you post the contents of your C source file? Have you tried compiling other sources as well, or compiled a Windows executable with your compiler?

Apart from that, DJGPP is rather outdated and not recommended for OS development. Many people here have reported that they had problems with DJGPP at later stages of the development process, so you might consider using a more recent compiler. The standard way is to build your own cross compiler toolchain as shown in the wiki:

GCC Cross-Compiler

Actually this is my third post within 10 minutes, all of them about building a cross compiler...

Re: GCC Problem

Posted: Sun Aug 14, 2011 9:39 am
by maakera
Hi,

I'd be happy to show you,
but the thing is i've set up an CC before and i was rather sure i did exactly like i did before.
1 C source file.
main.c

Code: Select all

void main()
{
    for (;;);
}
purely basic.
That what i ment by dumbing it down.

Thanks.

Re: GCC Problem

Posted: Sun Aug 14, 2011 11:04 am
by xenos
Hm... Try to add a bit more code, like this:

Code: Select all

int main()
{
    int i = 0;

    for(int j = 0; j < 10; j++)
        i += j;

    return i;
}

Re: GCC Problem

Posted: Sun Aug 14, 2011 4:23 pm
by maakera
Hi,

I tried using a different code but it didn't work,
maybe i should just try another gcc ?

Thanks.

Re: GCC Problem

Posted: Mon Aug 15, 2011 1:30 am
by xenos
Yes, that's probably a good idea. I guess you won't have much fun with DJGPP anyway.