From: "Ivor Blockley" Newsgroups: comp.os.msdos.djgpp Subject: Re: trouble linking/running code with RHIDE Date: Sun, 20 Jun 1999 13:18:06 +0800 Organization: iiNet Technologies Lines: 38 Message-ID: <7khtio$fm8$1@news.iinet.net.au> References: <7kh5v2$5lb$1 AT juliana DOT sprynet DOT com> NNTP-Posting-Host: reggae-03-143.nv.iinet.net.au X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com BWilliams wrote in message news:7kh5v2$5lb$1 AT juliana DOT sprynet DOT com... > I just downloaded DJGPP and RHIDE to try them out, and I can't get a program > to compile into an executable and run. > > Here's what I've been doing: > In RHIDE, I opened a *.cpp file that I know compiles properly with my old > Borland C++ compiler. > I tried to compile that file, and it compiled into an *.obj file with no > errors. > I tried to link the file, and got the (fairly usual) -lstdx error, and fixed > it without problem using the information in the FAQ. > I tried to link the file again, and now I get the following: > Error: c:/djgpp/lib/crt0.o(.data+0xc2):crt0.s: undefined reference to > 'main' > Error: c:/djgpp/lib/libc.a(crt1.o)(.text+0x446):crt1.c: undefined > reference to 'main' > > I've searched the FAQ for specific reference to this problem, and I can't > find it. Am I missing something in the FAQ? If not, does anyone have a > solution to this problem? > > Thanks > --Brandon Williams I encountered the same problem when I downloaded a C++ algorithm to calculate spline curve coefficients from the web. In this particular code, the author had placed a #ifdef CSPLINE before the main function and a #endif just after the main function (CSPLINE was defined in the header file). To get the project working I simply removed these two lines! As far as I can see this modification has had no adverse effects... Ivor Blockley tigereye AT iinet DOT net DOT au