YourFace
<span style="color:#9C9C9C;"><strong>Runner Up - T
- Reaction score
- 91
I'm currently using Dev-Cpp, and it gives me this error whenever I'm including the header file in the main func.
here's the code to the three files
Using Header Files.cpp(this is the file name)
security_code.h (this is the file name)
security_code.cpp
whenever I compile this, it highlights the line #include "security_code.h" in red
I don't know why it's considerred an error though =/
Does anyone know how to include the header file and make this work?
here's the error code
here's the code to the three files
Using Header Files.cpp(this is the file name)
Code:
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
#include "security_code.h"
int main()
{
cout <<"Danger Danger, you need the super secret security code" << endl;
cout <<"The code is " << endl;
cout << TheCode(15) << endl;
return 0;
}
Code:
string TheCode(int Code);//function prototype
Code:
#include <string>
string TheCode(int Code)
{
return "20-20-20";
}
whenever I compile this, it highlights the line #include "security_code.h" in red
I don't know why it's considerred an error though =/
Does anyone know how to include the header file and make this work?
here's the error code
Compiler: Default compiler
Building Makefile: "C:\Users\Garry\Desktop\New folder (2)\c++ exersises\Makefile.win"
Executing make...
make.exe -f "C:\Users\Garry\Desktop\New folder (2)\c++ exersises\Makefile.win" all
g++.exe -c "Using Header Files.cpp" -o "Using Header Files.o" -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
Using Header Files.cpp:5:27: security_code.h: No such file or directory
Using Header Files.cpp: In function `int main()':
Using Header Files.cpp:10: error: `TheCode' undeclared (first use this function)
Using Header Files.cpp:10: error: (Each undeclared identifier is reported only once for each function it appears in.)
make.exe: *** ["Using Header Files.o"] Error 1
Execution terminated
Building Makefile: "C:\Users\Garry\Desktop\New folder (2)\c++ exersises\Makefile.win"
Executing make...
make.exe -f "C:\Users\Garry\Desktop\New folder (2)\c++ exersises\Makefile.win" all
g++.exe -c "Using Header Files.cpp" -o "Using Header Files.o" -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
Using Header Files.cpp:5:27: security_code.h: No such file or directory
Using Header Files.cpp: In function `int main()':
Using Header Files.cpp:10: error: `TheCode' undeclared (first use this function)
Using Header Files.cpp:10: error: (Each undeclared identifier is reported only once for each function it appears in.)
make.exe: *** ["Using Header Files.o"] Error 1
Execution terminated