help-gplusplus
[Top][All Lists]
Advanced

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

Re: error compiling stl samples with g++ in cygwin


From: Paul Pluzhnikov
Subject: Re: error compiling stl samples with g++ in cygwin
Date: Tue, 01 May 2007 23:52:30 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

TheOne <daewon.yoon@gmail.com> writes:

> I downloaded sample codes from 
> http://www.cs.rpi.edu/~musser/stl-book/source/src.zip
> and tried to compile them.

Compiles fine for me using 
g++ (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)

> I started my cygwin on xp, renamed Makefile.unix to Makefile and typed
> "make". After several successful compilation, it spat out following
> error :
>
> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o):
> (.text+0xab): undefined reference to `_WinMain@16'
> collect2: ld returned 1 exit status
> make: *** [ex04-01] 오류 1

Check that ex04-01.cpp is not empty (it shouldn't be) and is readable:
$ wc -l ex04-01.cpp
39 ex04-01.cpp

> What can cause the problem?

I can reproduce the problem like this:

  echo "" > junk.cpp && g++ junk.cpp

Perhaps you've opened the source with a brain-damaged editor that
opens the file for writing and keeps it open? [Files opened for
writing without FILE_SHARE_READ mode can't be read by other
processes, I think.]

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]