Am 26.07.2006 um 21:37 schrieb Bo Peng:

scons: Configure: Checking for C function setenv()...
.sconf_temp/conftest_61.c <-
   |
   |
   |#include <assert.h>
   |
   |#ifdef __cplusplus
   |extern "C"
   |#endif
   |char setenv();
   |
   |int main() {
   |#if defined (__stub_setenv) || defined (__stub___setenv)
   |  fail fail fail
   |#else
   |  setenv();
   |#endif
   |
   |  return 0;
   |}
   |
g++ -o .sconf_temp/conftest_61.o -c -g -O -I/Developer/qt/
include .sconf_temp/conftest_61.c
.sconf_temp/conftest_61.c:8: error: declaration of C function 'char
setenv()' conflicts with
/usr/include/stdlib.h:226: error: previous declaration 'int setenv
(const char*, const char*, int)' here
scons: Configure: no

It looks to me that g++ treat this file as C++ file and complains
about the prototypes. What will happen if you compile it manually with
gcc? Note that g++/linux can compile this file without problem.
        
gcc works, g++ reports error.

$ g++ --version
powerpc-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5341)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


In my view the testfile should declare the correct prototype.

/Andreas

Reply via email to