delorie.com/archives/browse.cgi | search |
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 |
From: | "Al Slater" <al DOT slater AT scluk DOT com> |
To: | "'Christian Rudiger'" <christianruediger AT gmx DOT net>, <cygwin AT cygwin DOT com> |
Subject: | RE: g++ libcygwin.a has an undefined reference |
Date: | Tue, 18 May 2004 11:06:51 +0100 |
Message-ID: | <00ae01c43cbf$d7d88d50$350aa8c0@pavilion> |
MIME-Version: | 1.0 |
In-Reply-To: | <c8cn3t$21u$1@sea.gmane.org> |
X-Spam-Processed: | scluk.com, Tue, 18 May 2004 11:04:22 +0100 (not processed: message from valid local sender) |
X-Return-Path: | al DOT slater AT scluk DOT com |
X-MDaemon-Deliver-To: | cygwin AT cygwin DOT com |
X-IsSubscribed: | yes |
Reply-To: | cygwin AT cygwin DOT com |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id i4IA8t2D029367 |
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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |