469,902 Members | 1,933 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,902 developers. It's quick & easy.

Cannot Open #include<...> files Why??

I have 3 files, namely:
dArray.h
dArray.cp
TestdArray.cpp

Problem is when I compile the 'main' program - TestdArray.cpp - , it
(the compiller) produces the following error:

'Unable to open include file 'dArray.h'
'Unable to open include file'dArray.cp'

Obviously, the result is that the compiller doesn't see the variables
declared in
the 'main' program - TestdArray.cpp - and used as an instance of the
class declared and defined in the dArray.h and dArray.cp files and thus
produces other related error messages such as:

'variable_name undeclared (first use in this
function ...)

I don't seem to see any errors though ...

Here is my code in dArray.h ...
////////////////////////////////////////////////////////////////////////////////
#ifndef _MYDYNAM_
#define _MYDYNAM_

class DynamicArray{
public:
DynamicArray(int size=10, int inc=5); //default parameters

int Length(void) const; //length of the array
int Position(void *item) const; //returns the index of an
array as a position of the item whose value is pointed to by *item
void *Nth(int n) const; //will return a an address of the
nth value in the array

void Append(void *item); //adds a value pointed to by
*item

void *Remove(void *item);
void *Remove(int itempos);

private:
void Grow(int amount); //resizes the array dynamically

int fNum; //
int fSize; //the size of array
int fCSize;
int fInc; // size of increment
void **fItem; //

};

#endif
//////////////////////////////////////////////////////////////////////////////////

Here is the part of the code in the header section of dArray.cp ...

#include<stdlib.h>
#include<iostream.h>
#include<assert.h>
#include "dArray.h"

and here is the part of the code in the header section of my main
prog...

#include <iostream.h>
#include<string.h>
#include<stdlib.h>
#include "dArray.h" /* should this go as I have already included it
in the header of dArray.cp file */
#include "dArray.cp"

As I said, I don't think I made an error there as far as the
linking/inclusions of
the .h and .cp files are concerned. however, I keep getting the error
messages I stated above.

Any help please?

Jofio

Apr 11 '06 #1
2 4030
Jofio wrote:
I have 3 files, namely:
dArray.h
dArray.cp
TestdArray.cpp

Problem is when I compile the 'main' program - TestdArray.cpp - , it
(the compiller) produces the following error:

'Unable to open include file 'dArray.h'
'Unable to open include file'dArray.cp'

Please don't post the same question twice!

--
Ian Collins.
Apr 11 '06 #2
Ian, my appology for this but I stated that i did this in my reply to
your ealier reply.
thanks

Apr 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tom Cat | last post: by
18 posts views Thread by Tuckers | last post: by
2 posts views Thread by Bill Roper | last post: by
7 posts views Thread by Andre | last post: by
2 posts views Thread by David T. Ashley | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.