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

J

Jofio

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
 
I

Ian Collins

Jofio said:
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!
 
J

Jofio

Ian, my appology for this but I stated that i did this in my reply to
your ealier reply.
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top