Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <4.3.2.20010719101504.01ee7ab8@pop.ma.ultranet.com> X-Sender: lhall AT pop DOT ma DOT ultranet DOT com X-Mailer: QUALCOMM Windows Eudora Version 4.3 Date: Thu, 19 Jul 2001 10:21:30 -0400 To: Steve Lhomme , cygwin AT cygwin DOT com From: "Larry Hall (RFK Partners, Inc)" Subject: Re: Question on assert.h In-Reply-To: <995534942.3b56a85eed508@imp.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 05:29 AM 7/19/2001, Steve Lhomme wrote: >I'm using Cygwin to compile some MinGW32 stuff. And I have some assert() calls >in my code. But if I understand correctly when I use the -mno-cygwin -- >target=i386-mingw32 option I get the follwing include path : > >GNU CPP version 2.95.3-4 (cygwin special) (80386, BSD syntax) >#include "..." search starts here: >#include <...> search starts here: > . > /usr/include/g++-3 > /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-4/include > /usr/include > /usr/include/w32api >End of search list. >The following default directories have been omitted from the search path: >End of omitted list. > >The problem is that there is an assert.h in /usr/include and one >in /usr/include/w32api >The one from /usr/include has something like #define assert(x) __assert(... >The one from /usr/include/w32api has something like #define assert(x) _assert >(... > >And on the link, I get the following error : >AEncodeProperties.o: In function `AEncodeProperties::GetChannelModeString(int) >const': >/cygdrive/e/users/slhomme/lame/out_lame/AEncodeProperties.cpp:332: undefined >reference to `__assert' > >I think it should look for _assert and not __assert. >So how can I deal with that ??? First, figure out which assert you want, the one from /usr/include or the one from /usr/include/w32api. Then, figure out which library has the assert definition that does with the macro you chose. If the library is not libcygwin.a, include it in your link line. Presto, you're done! :-) BTW, this doesn't appear to be a Cygwin specific problem per-se. Larry Hall lhall AT rfk DOT com RFK Partners, Inc. http://www.rfk.com 118 Washington Street (508) 893-9779 - RFK Office Holliston, MA 01746 (508) 893-9889 - FAX (508) 560-1285 - cell phone -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/