autoconf
[Top][All Lists]
Advanced

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

Re: More exit() troubles


From: Wan-Teh Chang
Subject: Re: More exit() troubles
Date: Thu, 18 Jan 2001 08:10:11 -0800

Akim Demaille wrote:
> 
> Alexandre, help!
> 
> >>>>> "Lars" == Lars J Aas <address@hidden> writes:
> 
> Lars> I've attached a config.log that shows more problems with exit().
> Lars> The problem is that the Visual C++ compiler thinks exit is
> Lars> declared to be exported from the library it is compiling, and
> Lars> not to be imported from another system library.  This causes
> Lars> only a warning while compiling objects (exit status 0), but
> Lars> fails when we try to link an executable later in the configure
> Lars> script...
> 
> What if s/AC_COMPILE_IFELSE/AC_LINK_IFELSE/.
> 
> But anyway, I don't really understand what you say, and I'd really
> like to here from Alexandre on this...
> 
> Alexandre, the interesting log chunk is:
> 
> configure(3274) : error C2653: 'std' : is not a class or namespace name
> configure(3274) : warning C4273: 'exit' : inconsistent dll linkage.  
> dllexport assumed.
> configure(3274) : error C2653: 'std' : is not a class or namespace name
> configure(3274) : error C2873: 'exit' : symbol cannot be used in a 
> using-declaration
> configure:3288: $? = 2
> configure: failed program was:
> #line 3272 "configure"
> #include "confdefs.h"
> #include <stdlib.h>
> extern "C" void std::exit (int) throw (); using std::exit;
> int
> main ()
> {
> exit (42);
>   ;
>   return 0;
> }

<stdlib.h> declares exit() in one way, then this
test program declares exit() in another way.

I think the test should just say:
#include "confdefs.h"
#include <stdlib.h>
using std::exit;
int
main ()
{
  exit (42);
   ;
  return 0;
}

That is, the manual declaration of std::exit() should
be deleted.

Wan-Teh



reply via email to

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