Hello,
I'm wanting to have multiple .cpp files in one project. I have three files:
"Main.cpp"
"Secondary.cpp"
"Main.h"
This is the content of Main.cpp:
#include "Main.h"
#include <iostream>
void Engine();
int main()
{
b = 10;
a = 5;
std::cout << a << b;
Engine();
}
This is the content of Secondary.cpp:
#include "Main.h"
#include <iostream>
void Engine()
{
std::cout << std::endl << a;
}
This is the content of Main.h:
int a;
int b;
When I attempt to compile the project, it opens another file, called "locale_facets.tcc". It gives an error on line 2497: "multiple definition of `a'" as well as "multiple definition of `b'".
What did I do wrong?