-
rect.h
whenever I compile this program,
Code:
#include "rect.h"
SimpleWindow W("Main Window", 8.0, 8.0);
int ApiMain() {
W.Open();
RectangleShape R(W, 4.0, 4.0, Blue, 2.0, 3.0);
R.Draw();
return 0;
}
my compiler displays this
"cannot open include file: 'rect.h': no such file or directory"
how do I fix it?
-
By telling us what compiler and what ide you are using. Some IDEs require that you add every file you wish to include (that are not in the compilers standard search directories) to a project or similar.
-
>> "cannot open include file: 'rect.h': no such file or directory"
put rect.h in the program's directory (and put quotes around the include statement) or in a directory included in your compiler's %PATH%. also, if rect.h's code is declared in a separate namespace remember to either import the namespace (or components) or declare your code in the same namespace.
-
I'm using micosoft visua C++ 6.0
how do I find out what IDE I'm using?
-
you using visual studio 6 IDE. You need to have the file added to your project in order for the compiler to find it.
-
ok I added the file to my project but... 8 errors came up
error LNK2001: unresolved external symbol "public: __thiscall SimpleWindow::SimpleWindow(char const *,float,float,class Position const &)" (??0SimpleWindow@@QAE@PBDMMABVPosition@@@Z)
this is only the first one....
-
ok I ran the program again after adding the file "rect.h" to the project files and another error came up....
"unexpected end of file while looking for precompiled header directive"
thanks for any help given.... :)
-
Make sure when you make a new project, that you click on the Empty option, and then add to your program by going to the solution explorer, right-clicking, and adding files there. Make sure you put your new project in a place where you can see it, like the desktop.