Member Avatar

I keep getting these errors: Validation.obj : error LNK2005: "bool __cdecl dotDashRules(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?dotDashRules@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in main.obj Validation.obj : error LNK2005: "bool __cdecl IsValid(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?IsValid@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in main.obj I can't get rid of them. This program is an email validation program, btw. main.cpp [CODE] // Homework 1 #include <iostream> #include <fstream> #include <string> #include "Validation.cpp" using namespace std; bool IsValid(const string& emailAddress); void main() { //Input file to read emails from ifstream in("Email.txt"); //Output file to write 0s and 1s to ofstream out("Result.txt"); //0. While we are …

Member Avatar
0
7
Member Avatar

I wonder if anyone can point out the source of my error. I am using the SDK for commercial software which _requires_ that I build etc in Visual Studio 2008. I confess that my C++ is rusty at best and that I don't understand a lot about using Visual Studio. However, I have previously built code without this problem, so I'm a bit stumped about why it is happening now. When I first built my code, I got an error C3861 (identifier not found). Therefore I #included the appropriate file. However, that file has been #included in another part of …

Member Avatar
0
3

The End.