X-Originating-IP: [200.34.143.5] From: "J. L." To: References: Subject: Re: Newbie to DJGPP: linke error undefined reference to main Date: Fri, 4 Oct 2002 14:00:01 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Message-ID: X-OriginalArrivalTime: 04 Oct 2002 19:00:11.0377 (UTC) FILETIME=[43C33610:01C26BD8] Reply-To: djgpp AT delorie DOT com "Sams" wrote: > Hi, > > I am new to DJGPP. > I installed the DJGPP as descriped on the readme.1st file for Windows 2000 > system. > > When I ran the go32-v2 I got this message: > DPMI memory available: 75346 Kb > DPMI swap space available: 0 kb > > > When I compile a c program (gcc -c -Wall dsapi3.c ) it gives a warning but > create an object file dsapi3.o What is *exactly* the warning message? > When I link it (gcc -o dsapi3.dll dsapi3.o) ^^^^^^^ Are you trying build a DLL? This sound weird :-) > I got these messages > > C:/djgpp/lib/crt0.o(.data+0xc2):crt0.s:undefined reference to 'main' > C:/djgpp/lib/libc.a(crt1.o)(.text+0x404):crt1.c: undefined reference to > 'main' > collect2: ld returned 1 exit status > Obviously, you don't define a 'main' function in your source. After consulting my crystal ball, I guess that are you trying to build a library, and for this reason you don't need a main function. Well, if I'm correct, you need type at command line gcc -o libdsapi.a dsapi3.o The prefix 'lib' and the extension 'a' are both required. Of course, whitout more info, we can't give you a more helpful advice. HTH J. L.