[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help interpretting a g++ error?
From: |
Dan Stromberg |
Subject: |
Re: Help interpretting a g++ error? |
Date: |
Wed, 20 Jul 2005 20:40:24 GMT |
User-agent: |
Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) |
On Wed, 20 Jul 2005 10:14:57 -0700, Paul Pluzhnikov wrote:
> Dan Stromberg <strombrg@dcs.nac.uci.edu> writes:
>
>> I keep getting this weird "malloc not declared" errors when cstdlib is
>> included.
>
> Post a minimal example demonstrating the problem.
> The following:
>
> #include <cstdlib>
> int main()
> {
> return malloc(10) ? 0 : 1;
> }
>
> Compiles fine on AIX 5.1 with g++-3.3:
>
> $ /usr/local/gcc-3.3/bin/g++ junk.cpp && echo ok
> ok
>
> Cheers,
esmf04m-strombrg> cat t.C
main()
{
using ::malloc;
}
Wed Jul 20 13:38:56
esmf04m-strombrg> make t
g++ -v -maix64 t.C -o t
Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.6/specs
Configured with: ./configure
Thread model: aix
gcc version 3.3.6
/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.6/cc1plus -quiet -v
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=6 -D_XOPEN_SOURCE=500
-D_XOPEN_SOURCE_EXTENDED=1 -D_LARGE_FILE_API -D_ALL_SOURCE -D__64BIT__ t.C
-D__GNUG__=3 -quiet -dumpbase t.C -maix64 -auxbase t -version -o
/ptmp/strombrg/ccGlRYNe.s
GNU C++ version 3.3.6 (powerpc-ibm-aix5.1.0.0)
compiled by GNU C version 3.3.6.
GGC heuristics: --param ggc-min-expand=32 --param ggc-min-heapsize=4096
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/powerpc-ibm-aix5.1.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/c++/3.3.6
/usr/local/include/c++/3.3.6/powerpc-ibm-aix5.1.0.0
/usr/local/include/c++/3.3.6/backward
/usr/local/include
/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.6/include
/usr/include
End of search list.
t.C: In function `int main()':
t.C:4: error: `malloc' not declared
make: *** [t] Error 1
Wed Jul 20 13:39:34
esmf04m-strombrg>