[SOLVED] GCC Problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
maakera
Posts: 14
Joined: Sun Apr 10, 2011 10:23 am
Location: Estonia

[SOLVED] GCC Problem

Post 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
Last edited by maakera on Thu Aug 18, 2011 4:47 am, edited 1 time in total.
The most basic language is the most advanced language.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: GCC Problem

Post 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...
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
maakera
Posts: 14
Joined: Sun Apr 10, 2011 10:23 am
Location: Estonia

Re: GCC Problem

Post 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.
The most basic language is the most advanced language.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: GCC Problem

Post 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;
}
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
maakera
Posts: 14
Joined: Sun Apr 10, 2011 10:23 am
Location: Estonia

Re: GCC Problem

Post by maakera »

Hi,

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

Thanks.
The most basic language is the most advanced language.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: GCC Problem

Post by xenos »

Yes, that's probably a good idea. I guess you won't have much fun with DJGPP anyway.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Post Reply