Re: compile bunch of file in gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I know but this is from a book.
BTW, thank you.

On Sun, Feb 5, 2012 at 11:57 AM, Kai Ruottu <kai.ruottu@xxxxxxxxxxx> wrote:
> 3.2.2012 22:56, esmaeil mirzaee kirjoitti:
>
>> thanks for your reply.
>> I read your document but unfortunately It doesn't help more.
>>
>> When I compile DieWithError.c I've got below error:
>>
>> $ gcc -o DieWithError DieWithError.c
>> /usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/crt1.o: In function
>> `_start':
>> (.text+0x18): undefined reference to `main'
>> collect2: ld returned 1 exit status
>
>
> Yes, every executable made in C and C++ needs the 'main()' function
> in Unix/console-apps, in Win32 GUI apps that would be 'WinMain()'...
> So you must provide this. The functions in your 'DieWithError.c' seem
> to be only subfunctions, expected to be called from some main program.
>
> The chapter 3 "The form of a C program" in the tutor book should tell
> this thing.



-- 
Best
Esmaeil
https://sites.google.com/site/esmaeilmirzaee


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux