Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Christian Rudiger <christianruediger AT gmx DOT net> Subject: Re: g++ libcygwin.a has an undefined reference Date: Tue, 18 May 2004 11:23:15 +0100 Lines: 155 Message-ID: <c8cnvd$4bp$1@sea.gmane.org> References: <c8cn3t$21u$1 AT sea DOT gmane DOT org> <00ae01c43cbf$d7d88d50$350aa8c0 AT pavilion> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: z301.alex.wh.tu-darmstadt.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 In-Reply-To: <00ae01c43cbf$d7d88d50$350aa8c0@pavilion> Hello Al, thank you, it worked. i putted one at the end of the program just writing : }; // end of class int main(){} why does that work? I think thats strange. Regards Christian Rudiger Al Slater wrote: > Try putting a main function in the program! > > Regards > > Al > > >>-----Original Message----- >>From: cygwin-owner AT cygwin DOT com >>[mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Christian Rudiger >>Sent: 18 May 2004 11:09 >>To: cygwin AT cygwin DOT com >>Subject: g++ libcygwin.a has an undefined reference >> >> >>Hello there, >> >>i think the following problem has to do with cygwin, cause >>libcygwin.a >>has an undefined reference. >>I get the error message when compiling my little testprogram. >>The Programm and complete compiler messages follow: >> >>************************************************************* >> >>// reading a text file >>#include <iostream.h> >>#include <fstream.h> >>#include <stdlib.h> >>#include <string.h> >> >>using namespace std; >> >>class tryit { >> >> char *FILE_POSTFIX;// = new "myfile.txt"; <- ausserhalb >>nicht m�glich >> string posti; >>public: >> int main (int argc, char** argv) { >> >> FILE_POSTFIX = new char[10]; //"Nodes.txt"; <- erst >>allocieren dann >>zuweisen ! >> FILE_POSTFIX = "NODES.txt"; >> char *filename = FILE_POSTFIX; >> char *output; >> ifstream in (filename) ; >> while (in){ >> in >> output ; >> cout << output << endl; >> return 0; >> } >> } >>}; >> >>************************************************************* >> >>g++ -v -Wall -Wno-deprecated tryme.cpp -o testthings.exe >>Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs >>Configured with: /GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld >>--with-gnu-as --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc >>--libdir=/usr/lib --libexecdir=/usr/sbin --mandir=/usr/share/man >>--infodir=/usr/share/info >>--enable-languages=c,ada,c++,f77,pascal,java,objc --enable-libgcj >>--enable-threads=posix --with-system-zlib --enable-nls >>--without-included-gettext --enable-interpreter >>--enable-sjlj-exceptions >>--disable-version-specific-runtime-libs --enable-shared >>--disable-win32-registry --enable-java-gc=boehm >>--disable-hash-synchronization --verbose --target=i686-pc-cygwin >>--host=i686-pc-cygwin --build=i686-pc-cygwin >>Thread model: posix >>gcc version 3.3.1 (cygming special) >> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/cc1plus.exe -quiet -v >>-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 >>-D__CYGWIN32__ >>-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../include/w32api >>-idirafter >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygw > > in/lib/../../include/w32api > >>tryme.cpp -D__GNUG__=3 -quiet -dumpbase tryme.cpp -auxbase >>tryme -Wall >>-Wno-deprecated -version -o /cygdrive/d/TMP/cc55YaOO.s >>GNU C++ version 3.3.1 (cygming special) (i686-pc-cygwin) >> compiled by GNU C version 3.3.1 (cygming special). >>GGC heuristics: --param ggc-min-expand=47 --param >>ggc-min-heapsize=32700 ignoring nonexistent directory >>"/usr/local/include" ignoring nonexistent directory >>"/usr/i686-pc-cygwin/include" ignoring duplicate directory >>"/usr/i686-pc-cygwin/lib/../../include/w32api" >>#include "..." search starts here: >>#include <...> search starts here: >> /usr/include/c++/3.3.1 >> /usr/include/c++/3.3.1/i686-pc-cygwin >> /usr/include/c++/3.3.1/backward >> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include >> /usr/include >> /usr/include/w32api >>End of search list. >> >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygw > > in/bin/as.exe > >>--traditional-format -o /cygdrive/d/TMP/ccbPwKZW.o >>/cygdrive/d/TMP/cc55YaOO.s >> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/collect2.exe -Bdynamic >>--dll-search-prefix=cyg -o testthings.exe >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../crt0.o >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/crtbegin.o >>-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1 >>-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../.. >>/cygdrive/d/TMP/ccbPwKZW.o -lstdc++ -lgcc -lcygwin -luser32 >>-lkernel32 >>-ladvapi32 -lshell32 -lgcc >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/crtend.o >>/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../libcygwin.a(lib >>cmain.o)(.text+0x7c): >>undefined reference to `_WinMain AT 16' >>collect2: ld returned 1 exit status >>make: *** [testthings.exe] Error 1 >> >>Compilation exited abnormally with code 2 at Tue May 18 11:05:17 >> >> >>Regards Christian Rudiger >> >> >>-- >>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple >>Problem reports: http://cygwin.com/problems.html >>Documentation: http://cygwin.com/docs.html >>FAQ: http://cygwin.com/faq/ >> > > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/