help-gplusplus
[Top][All Lists]
Advanced

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

Re: Help interpretting a g++ error?


From: Paul Pluzhnikov
Subject: Re: Help interpretting a g++ error?
Date: Wed, 20 Jul 2005 17:36:41 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Dan Stromberg <strombrg@dcs.nac.uci.edu> writes:

> esmf04m-strombrg> cat t.C
>
> main()
>         {
>         using ::malloc;
>         }

This is not a well-formed C++ program.

In your original message, you said:
> I keep getting this weird "malloc not declared" errors when cstdlib is
> included. 

Fixing the test above:

$ cat t.C
#include <cstdlib>
int main()
{
    using ::malloc;
}

makes it compile just fine.

> t.C: In function `int main()':
> t.C:4: error: `malloc' not declared
> make: *** [t] Error 1

Naturally: you didn't #include appropriate header, hence the error.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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