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: <3AE4DAB0.610B1A6@ece.gatech.edu> Date: Mon, 23 Apr 2001 21:45:20 -0400 From: "Charles S. Wilson" X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: tazium AT yahoo DOT com CC: cygwin AT cygwin DOT com Subject: Re: dbm.h reserved word. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The gdbm package is not necessarily set up for use with C++. When you name a souce file with the .cpp extension, it automatically goes into g++ mode, which causes cpp to include a bunch of other header files (worse, C++ has a keyword called "delete"). Both of the following compile: 1) rename main.cpp to main.c, compile as before ('gcc -o -c main.o main.c') 2) modify the file as follows: extern "C" { #define delete dbm_delete #include #undef delete } int main (void) { return 0; } Of course, for #2, you'd have to explicitly call "dbm_delete" in your application code when you want to remove a key from the dbm database, and use the "delete" keyword when you want to free an unused object. (You can't use the #define hack in your application code, or you'll conflate those two operations) --Chuck Travis Smith wrote: > > Using experimental packages of gcc, mingw, w32, cygwin. > > > > extern GDBM_EXPORT(int, delete) (); > > > > Which after looking at the top defines into: > GDBM_IMPEXP int GDBM_API delete (); > which goes to > __declspec(dllexport) int __cdecl delete (); > > which is pulling delete from a dll as far as I know. (I haven't worked with > dlls too much). > > There's a parse error on that line. I'm done, I don't know what's up. > > > > ~/src $ cat main.cpp > #include > > int main ( void ) > { > return 0; > } > ~/src $ make > gcc -c -o main.o main.cpp > In file included from main.cpp:1: > /usr/include/dbm.h:85: parse error before `delete' > make: *** [main.o] Error 1 > ~/src $ > > > > ~Travis Smith > IT Professional > tazium AT yahoo DOT com > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple