Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error, cannot open include file: 'alloc.h':

Status
Not open for further replies.

awinnn

MIS
Jul 21, 2003
166
MY
I've created project and when i compile the project, the error appear.
Any idea?
This is my 'alloc.h' file. Is it correct?


#ifndef _BACKWARD_ALLOC_H
#define _BACKWARD_ALLOC_H 1

#include "backward_warning.h"
#include <bits/c++config.h>
#include <bits/allocator.h>
#include <ext/debug_allocator.h>
#include <ext/malloc_allocator.h>

using __gnu_cxx::__malloc_alloc;
using __gnu_cxx::__debug_alloc;
using __gnu_cxx::__pool_alloc;
using std::__alloc;
using std::__simple_alloc;
using std::allocator;

#endif
 
do you include it as
#include<alloc.h>
or
#include&quot;alloc.h&quot;?
If the file is inside your project then you should use the second variant.

Ion Filipski
1c.bmp
 
> the error appear.
Details please - what was the exact text of the error?

> #include &quot;backward_warning.h&quot;
It's telling you that this particular header file is obsolete and you should use whatever the new header is.
It will still work for the moment, but you should be looking to update your source code to remove the dependency on old headers at some point.

From looking at some of the gcc STL header files, those which need to allocate memory automatically include the correct allocation header file. My guess is you can just delete
Code:
#include <alloc.h>
from your source file.


--
 
Hi all,
the error is,
fatal error C1083: Cannot open include file: 'alloc.h': No such file or directory

i've replaced with #include&quot;alloc.h&quot; but there was an error,

fatal error C1083: Cannot open include file: 'backward_warning.h': No such file or directory
Error executing cl.exe.

Any idea?
 
> Error executing cl.exe.
OK, now I'm confused.

You're using VC++ command line compiler (cl.exe) to compile a program which a bunch of header files from gcc?

Copying random header files from another compiler just because the filename is the same as the one you're looking for isn't going to work.

Like I said previously, alloc.h is a deprecated header, so in some ways it doesn't matter that it can't be found. I'd just delete that #include from your source (or comment it out) and see what happens.



--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top