I've made a program that generates a Character's details(Game details, like level, name, HP, etc, based on a few parameters). I've added another .cpp file to it [without a main() function], but when I try to compile the whole project in Dev-Cpp, it just shows an error. My code is:

#include <iostream>
#include <fstream>
#include <string>
#include "character.h"

#define ReadCharacterFromThisFile "CharacterRecord.def"

Character AssignCharacter;//Class Declaration

void ReadCharacter()
{
     std::string TempReadCharacter;
     bool tempVar=false;
     AssignCharacter.LineCount=0;
     unsigned int Potency;
     double hp, off, def, mod;
          
     std::ifstream ReadThisCharacter(ReadCharacterFromThisFile, std::ios::in);
     
     while(std::getline(ReadThisCharacter, TempReadCharacter, '\n'))
     {
                   AssignCharacter.LineCount++;
                   }
     
     for(unsigned int l=0; l <= AssignCharacter.LineCount; l++)
     {
                  TempReadCharacter="";
                  if(l == 3)
                  {
                       ReadThisCharacter >> TempReadCharacter;
                       std::cout << "\n\n\tCharacter's Name:: " << AssignCharacter.EncryptDecrypt(TempReadCharacter) << "\n\n\t";
                       }
                  if(l == 4)
                  {
                       ReadThisCharacter >> TempReadCharacter;
                       std::cout << "Spell Used:: " << AssignCharacter.EncryptDecrypt(TempReadCharacter);
                       }
                  if(l == 5)
                  {
                       ReadThisCharacter >> TempReadCharacter;
                       std::cout << "\n\n\tCharm Used:: " << AssignCharacter.EncryptDecrypt(TempReadCharacter);
                       }
                  if(l == 6)
                  {
                       ReadThisCharacter >> TempReadCharacter;
                       std::cout << "\n\n\tCurse Used:: " << AssignCharacter.EncryptDecrypt(TempReadCharacter);
                       }
                  if(l == 7)
                  {
                       ReadThisCharacter >> tempVar;
                       std::cout << "\n\n\tVeritaserum Marker (Spell):: " << tempVar;
                       }
                  if(l == 8)
                  {
                       tempVar=false;
                       ReadThisCharacter >> tempVar;
                       std::cout << "\n\n\tVeritaserum Marker (Charm):: " << tempVar;
                       }
                  if(l == 9)
                  {
                       tempVar=false;
                       ReadThisCharacter >> tempVar;
                       std::cout << "\n\n\tVeritaserum Marker (Curse):: " << tempVar;
                       }
                  if(l == 10)
                  {
                       ReadThisCharacter >> AssignCharacter.identifier;
                       }
                  if(l == 11)
                  {
                       ReadThisCharacter >> Potency;
                       }
                  if(l == 12)
                  {
                       ReadThisCharacter >> hp;
                       }
                  if(l == 13)
                  {
                       ReadThisCharacter >> off;
                       }
                  if(l == 14)
                  {
                       ReadThisCharacter >> def;
                       }
                  if(l == 15)
                  {
                       ReadThisCharacter >> mod;
                       }
                  }
}

This code when compiled with the main project, gives this compiler error:

multiple definition of `ReadCharacter()' 
  first defined here 
  multiple definition of `AssignCharacter' 
  first defined here 
  ld returned 1 exit status 
 C:\Documents and Settings\Admin\My Documents\OOC++\HP\Makefile.win [Build Error]   [HP.exe] Error 1

with no line references! I can't find where these have been defined before!

Could anyone help with this?

nvm shush i should think

perhaps its in your other file

nvm shush i should think

perhaps its in your other file

Well, This is my other file::

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <windows.h>
#include "character.h"
#include "dictionary.h"
#include "dictionarylist.h"
#include "colour.h"
#include "readcharacter.cpp"

using namespace std;

#define RecordCharacterToFile "CharacterRecord.txt"
#define EncryptCharacterToFile "CharacterRecord.def"

const int NeverUsed=system("color 1F");//Sets Console Colour
Character InheritCharacter;//Class Declaration

void DisplayCharms(), DisplaySpells(), DisplayCurses();
int i, q, j, CompMagic, CompPotency, temp;

bool CompareCharmsInput(std::string Magic)
{
            bool isItTrue=false;
            
            for(j=0; j<sizeof(CharmsList)/sizeof(std::string); j++)
            {
                    string CompareThisCharm = CharmsList[j];
                    const char* CTC = CompareThisCharm.c_str();
                    
                    CompMagic=Magic.compare(CompareThisCharm);
                    
                    if(CompMagic == 0)
                    {
                                 isItTrue=true;
                                 }
                                 else
                                 {
                                     q=1;
                                     int MatchCharm = strncmp (CTC, Magic.c_str(), q);
                                     if(MatchCharm == 0)
                                      cout << "\n\n\tDid You Mean: " << setw(20) << CTC << "\t(Charm)";
                                     
                                     q++;
                                     }                                 
                    }
            
            return isItTrue;
}

bool CompareSpellsInput(std::string Magic)
{
            bool isItTrue=false;
            
            for(j=0; j<sizeof(SpellsList)/sizeof(std::string); j++)
            {
                    string CompareThisSpell = SpellsList[j];                    
                    const char* CTS = CompareThisSpell.c_str();
                    
                    CompMagic=Magic.compare(CompareThisSpell);
                    
                    if(CompMagic == 0)
                    {
                                 isItTrue=true;
                                 }
                                 else
                                 {
                                     q=1;
                                     int MatchSpell = strncmp (CTS, Magic.c_str(), q);
                                     if(MatchSpell == 0)
                                      cout << "\n\n\tDid You Mean: " << setw(20) << CTS << "\t(Spell)";
                                     
                                     q++;
                                     }
                    }
            
            return isItTrue;
}

bool CompareCursesInput(std::string Magic)
{
            bool isItTrue=false;
            
            for(j=0; j<sizeof(CursesList)/sizeof(std::string); j++)
            {
                    string CompareThisCurse = CursesList[j];                    
                    const char* CTCu = CompareThisCurse.c_str();
                    
                    CompMagic=Magic.compare(CompareThisCurse);
                    
                    if(CompMagic == 0)
                    {
                                 isItTrue=true;
                                 }
                                 else
                                 {
                                     q=1;
                                     int MatchCurse = strncmp (CTCu, Magic.c_str(), q);
                                     if(MatchCurse == 0)
                                      cout << "\n\n\tDid You Mean: " << setw(20) << CTCu << "\t(Curse)";
                                     
                                     q++;
                                     }
                    }
            system("Color 2F");
            
            return isItTrue;
}

int PotencyOfCharactersMagic(std::string Potent1, std::string Potent2, std::string Potent3)
{
            int PotencyLvl=0;
            /*InheritCharacter.NumberOfOff=0;
            InheritCharacter.NumberOfDef=0;
            InheritCharacter.NumberOfCharms=0;
            
            InheritCharacter.PowerOfOff=0;
            InheritCharacter.PowerOfDef=0;
            InheritCharacter.PowerOfCharms=0;*/
            
            //This is for String1            
            for(j=0; j<sizeof(Danger)/sizeof(std::string); j++)
            {
                    string CompareDanger = Danger[j];
                    CompPotency = Potent1.compare(CompareDanger);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=8;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfOff+=5;
                               temp--;
                               }
                       InheritCharacter.NumberOfOff+=1;
                       }
                       }
            for(j=0; j<sizeof(Defence)/sizeof(std::string); j++)
            {
                    string CompareDanger2 = Defence[j];
                    CompPotency = Potent1.compare(CompareDanger2);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=6;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfDef+=6;
                               temp--;
                               }
                       InheritCharacter.NumberOfDef+=1;
                       }
                       }
            for(j=0; j<sizeof(Offense)/sizeof(std::string); j++)
            {
                    string CompareDanger3 = Defence[j];
                    CompPotency = Potent1.compare(CompareDanger3);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=7;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfOff+=4;
                               temp--;
                               }
                       InheritCharacter.NumberOfOff+=1;
                       }                       
                       }
            for(j=0; j<sizeof(Charmed)/sizeof(std::string); j++)
            {
                    string CompareDanger4 = Charmed[j];
                    CompPotency = Potent1.compare(CompareDanger4);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=5;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfCharms+=1;
                               temp--;
                               }
                       InheritCharacter.NumberOfCharms+=1;
                       }
                       }
            
            //This is for String2
            for(j=0; j<sizeof(Danger)/sizeof(std::string); j++)
            {
                    string CompareDanger = Danger[j];
                    CompPotency = Potent2.compare(CompareDanger);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=8;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                              InheritCharacter.PowerOfOff+=6;
                              temp--;
                              }
                       InheritCharacter.NumberOfOff+=1;
                       }
                       }
            for(j=0; j<sizeof(Defence)/sizeof(std::string); j++)
            {
                    string CompareDanger2 = Defence[j];
                    CompPotency = Potent2.compare(CompareDanger2);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=6;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfDef+=6;
                               temp--;
                               }
                       InheritCharacter.NumberOfDef+=1;
                       }
                       }
            for(j=0; j<sizeof(Offense)/sizeof(std::string); j++)
            {
                    string CompareDanger3 = Defence[j];
                    CompPotency = Potent2.compare(CompareDanger3);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=7;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfOff+=4;
                               temp--;
                               }
                       InheritCharacter.NumberOfOff+=1;
                       }                       
                       }
            for(j=0; j<sizeof(Charmed)/sizeof(std::string); j++)
            {
                    string CompareDanger4 = Charmed[j];
                    CompPotency = Potent2.compare(CompareDanger4);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=5;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfCharms+=1;
                               temp--;
                               }
                       InheritCharacter.NumberOfCharms+=1;
                       }
                       }
                       
            //This is For String 3
            
            for(j=0; j<sizeof(Danger)/sizeof(std::string); j++)
            {
                    string CompareDanger = Danger[j];
                    CompPotency = Potent3.compare(CompareDanger);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=8;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfOff+=5;
                               temp--;
                               }
                       InheritCharacter.NumberOfOff+=1;
                       }
                       }
            for(j=0; j<sizeof(Defence)/sizeof(std::string); j++)
            {
                    string CompareDanger2 = Defence[j];
                    CompPotency = Potent3.compare(CompareDanger2);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=6;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfDef+=6;
                               temp--;
                               }
                       InheritCharacter.NumberOfDef+=1;
                       }
                       }
            for(j=0; j<sizeof(Offense)/sizeof(std::string); j++)
            {
                    string CompareDanger3 = Defence[j];
                    CompPotency = Potent3.compare(CompareDanger3);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=7;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfOff+=4;
                               temp--;
                               }
                       InheritCharacter.NumberOfOff+=1;
                       }                       
                       }
            for(j=0; j<sizeof(Charmed)/sizeof(std::string); j++)
            {
                    string CompareDanger4 = Charmed[j];
                    CompPotency = Potent3.compare(CompareDanger4);
                    if(CompPotency == 0)
                    {
                       PotencyLvl+=5;
                       temp=PotencyLvl;
                       while(temp!=false)
                       {
                               InheritCharacter.PowerOfCharms+=1;
                               temp--;
                               }
                       InheritCharacter.NumberOfCharms+=1;
                       }
                       }
            
            return PotencyLvl;
}

int main()
{    
    char ch;
    
    cout << "\n\n\tThe Magic Wand!";
    
    cout << "\n\n\tDo You Want to View a List of Available Charms? (y/n) ::==:: ";
    cin >> ch;    
    if(ch=='y')
    {
               DisplayCharms();
               cin.get();
               system("cls");
               }
               cin.get();
    cout << "\n\n\tDo You Want to View a List of Available Spells? (y/n) ::==:: ";
    cin >> ch;
    if(ch=='y')
    {
               DisplaySpells();
               cin.get();
               system("cls");
               }
               cin.get();
    cout << "\n\n\tDo You Want to View a List of Available Curses? (y/n) ::==:: ";
    cin >> ch;
    if(ch=='y')
    {
               DisplayCurses();
               cin.get();
               system("cls");
               }
               cin.get();
               
    cout << "\n\n\n\t::==::__::==:: Enter Your Character's Details below ::==::__::==::\n\n";
    cout << "\n\n\tIn Case you need to enter more than one Spell, Curse or\n\tCharm, then separate with a comma \',\'";
    cout << "\n\n\tIf You do not want your character to possess a skill, then\n\tleave it blank (i.e press Enter)";
    
    cout << "\n\n\n\t\tPlease Enter Character's Name: ";
    getline(cin, InheritCharacter.CharacterName);
    cout << "\n\n\t\tPlease Enter your favourite Spell(s): ";
    getline(cin, InheritCharacter.Spells);
    cout << "\n\n\t\tPlease Enter favourite Charm(s): ";
    getline(cin, InheritCharacter.Charms);
    cout << "\n\n\t\tPlease Enter favourite Curse(s): ";
    getline(cin, InheritCharacter.Curses);
    
    Compare SpellsToDictionary;//Call on Spells Dictionary Function
    Compare CharmsToDictionary;//Call on Charms Dictionary Function
    Compare CursesToDictionary;//Call on Charms Dictionary Function
    Potency GetPotencyOfMagic;//Call on Charms Dictionary Function
    
    ofstream RecordCharacterDetails(RecordCharacterToFile, ios::out | ios::trunc);
    ofstream EncryptCharacterDetails(EncryptCharacterToFile, ios::out | ios::trunc);
    if((! RecordCharacterDetails.is_open()) || (! EncryptCharacterDetails.is_open()))
    {
         system("Color F0");
         cerr << "\n\n\tThe Program cannot create your character!!";
         cin.get();
         exit(0);
         }
    
    SpellsToDictionary = CompareSpellsInput;//Assigns the right Function
    CharmsToDictionary = CompareCharmsInput;//Assigns the right Function
    CursesToDictionary = CompareCursesInput;//Assigns the right Function
    GetPotencyOfMagic = PotencyOfCharactersMagic;//Assigns the right Function
    
    bool isItASpell = SpellsToDictionary(InheritCharacter.Spells);//Returns a True/False Value
    bool isItACharm = CharmsToDictionary(InheritCharacter.Charms);//Returns a True/False Value
    bool isItACurse = CursesToDictionary(InheritCharacter.Curses);//Returns a True/False Value
    int GetPotency = GetPotencyOfMagic(InheritCharacter.Charms, InheritCharacter.Curses, InheritCharacter.Spells);
    
    InheritCharacter.ItsACharm=isItACharm;//Sets Bool; Required for Identifier
    InheritCharacter.ItsACurse=isItACurse;//Sets Bool; Required for Identifier
    InheritCharacter.ItsASpell=isItASpell;//Sets Bool; Required for Identifier
    InheritCharacter.PotencyOfMagic=GetPotency;//Sets Double; Required for Calculating HP
    
    
    cout << "\n\n\n\n\tVeritaserum(Truth) Markers::\t" << isItASpell << "\t" << isItACharm << "\t" << isItACurse;//It Works!
    cout << "\n\n\tIdentifiers Found:: " << InheritCharacter.getIdentifier(InheritCharacter.ItsACharm, InheritCharacter.ItsACurse, InheritCharacter.ItsASpell);
    cout << "\n\n\tPotency of Magic:: " << GetPotency;
    cout << "\n\n\tMagic HP:: " << InheritCharacter.CastMagicHp(InheritCharacter.PotencyOfMagic);
    cout << "\n\n\tOffensive Character:: " << InheritCharacter.CalculateOffensiveCharacter(InheritCharacter.PowerOfOff, InheritCharacter.NumberOfOff);
    cout << "\n\n\tDefensive Character:: " << InheritCharacter.CalculateDefensiveCharacter(InheritCharacter.PowerOfDef, InheritCharacter.NumberOfDef);
    cout << "\n\n\tModerate Character:: " << InheritCharacter.CalculateCharmativeCharacter(InheritCharacter.PowerOfCharms, InheritCharacter.NumberOfCharms);
    
    //Record To file
    RecordCharacterDetails << "####Character Records for ::==:: " << InheritCharacter.CharacterName << " ::==:: ####\n\n";
    RecordCharacterDetails << "#Character Name::\n" << InheritCharacter.CharacterName;
    RecordCharacterDetails << "\n\n#Spell Entered::\n" << InheritCharacter.Spells;
    RecordCharacterDetails << "\n\n#Charm Entered::\n" << InheritCharacter.Charms;
    RecordCharacterDetails << "\n\n#Curse Entered::\n" << InheritCharacter.Curses;
    RecordCharacterDetails << "\n\n#Veritaserum Marker (Spell)::\n" << isItASpell << "\n\n#Veritaserum Marker (Charm)::\n" << isItACharm << "\n\n#Veritaserum Marker (Curse)::\n" << isItACurse;
    RecordCharacterDetails << "\n\n#Identifiers Found::\n" << InheritCharacter.getIdentifier(InheritCharacter.ItsACharm, InheritCharacter.ItsACurse, InheritCharacter.ItsASpell);
    RecordCharacterDetails << "\n\n#Potency of Magic::\n" << GetPotency;
    RecordCharacterDetails << "\n\n#Magic HP::\n" << InheritCharacter.CastMagicHp(InheritCharacter.PotencyOfMagic);
    RecordCharacterDetails << "\n\n#Offensive Character::\n" << InheritCharacter.CalculateOffensiveCharacter(InheritCharacter.PowerOfOff, InheritCharacter.NumberOfOff);
    RecordCharacterDetails << "\n\n#Defensive Character::\n" << InheritCharacter.CalculateDefensiveCharacter(InheritCharacter.PowerOfDef, InheritCharacter.NumberOfDef);
    RecordCharacterDetails << "\n\n#Moderate Character::\n" << InheritCharacter.CalculateCharmativeCharacter(InheritCharacter.PowerOfCharms, InheritCharacter.NumberOfCharms);
    
    //Encrypt To and Record To File    
    EncryptCharacterDetails << InheritCharacter.EncryptDecrypt("####Character Records for ::==:: ") << InheritCharacter.EncryptDecrypt(InheritCharacter.CharacterName) << InheritCharacter.EncryptDecrypt(" ::==:: ####");
    EncryptCharacterDetails << "\n\n" << InheritCharacter.EncryptDecrypt(InheritCharacter.CharacterName);
    EncryptCharacterDetails << "\n" << InheritCharacter.EncryptDecrypt(InheritCharacter.Spells);
    EncryptCharacterDetails << "\n" << InheritCharacter.EncryptDecrypt(InheritCharacter.Charms);
    EncryptCharacterDetails << "\n" << InheritCharacter.EncryptDecrypt(InheritCharacter.Curses);
    EncryptCharacterDetails << "\n" << isItASpell << "\n" << isItACharm << "\n" << isItACurse;
    EncryptCharacterDetails << "\n" << InheritCharacter.getIdentifier(InheritCharacter.ItsACharm, InheritCharacter.ItsACurse, InheritCharacter.ItsASpell);
    EncryptCharacterDetails << "\n" << GetPotency;
    EncryptCharacterDetails << "\n" << InheritCharacter.CastMagicHp(InheritCharacter.PotencyOfMagic);
    EncryptCharacterDetails << "\n" << InheritCharacter.CalculateOffensiveCharacter(InheritCharacter.PowerOfOff, InheritCharacter.NumberOfOff);
    EncryptCharacterDetails << "\n" << InheritCharacter.CalculateDefensiveCharacter(InheritCharacter.PowerOfDef, InheritCharacter.NumberOfDef);
    EncryptCharacterDetails << "\n" << InheritCharacter.CalculateCharmativeCharacter(InheritCharacter.PowerOfCharms, InheritCharacter.NumberOfCharms);
        
    cin.get();
    RecordCharacterDetails.close();
    EncryptCharacterDetails.close();
    
    cout << "\n\n\tDo You Want to DeCrypt the info?";
    cout << "\n\n\t";
    cin.get();
    cin.get();
    return 0;
}

void DisplayCharms()
{
     system("Color 4F");
     cout << "\n\n\t";
     
     for(j=0; j<sizeof(CharmsList)/sizeof(string); j++)
     {
              cout << CharmsList[j] << "\n\t";
              }
              cin.get();
}

void DisplaySpells()
{
     system("Color 4F");
     cout << "\n\n\t";
     
     for(j=0; j<sizeof(SpellsList)/sizeof(string); j++)
     {
              cout << SpellsList[j] << "\n\t";
              }
              cin.get();
}

void DisplayCurses()
{
     system("Color 4F");
     cout << "\n\n\t";
     
     for(j=0; j<sizeof(CursesList)/sizeof(string); j++)
     {
              cout << CursesList[j] << "\n\t";
              }
              cin.get();
}

It Depends on other files, which absolutely do NOT contain those names:

Well my only suggestion is that it is in character.h, since that is where it appears those classes and functions are defined

Just zip up the whole project (minus object files) and attach them to your post so we can test it for you.

Why you include readcharacter.cpp in the "other file"? It seems you don't understand the principle of a splitting a program to separate modules. Now you have ReadCharacter function body in both modules. Of course, the linker (it's a part of your programming system: linker builds exe from separately compiled modules) issues this diagnostic message. The linker does not know about line numbers: it works with compiled (object) modules.

There are many others suspicious code fragments in your code. For example:

Character InheritCharacter;//Class Declaration

Do you know that it's NOT a class declaration in C++? A class declaration is a construct started with:

class Character ... { ...

Or

... j<sizeof(Danger)/sizeof(std::string); ...

I hope you know that sizeof(std::string) is not a length of a string contents. Congratulation! You have wrote a very cryptic code: where is Danger declaration? Probably, it's a global string array declared in .h file. But if it's a pointer to dynamically allocated string array, you will have some troubles.
Now CompareThisCharm and Magic are strings.

CompMagic=Magic.compare(CompareThisCharm);
if(CompMagic == 0)

What for so mannered code? Keep it simpler:

if (Magic == CompareThisCharm)

You have a lots of global variables in numerous header files. As a result of this bad design solution it's absolutely unclear what every module must do, what's types of variables. Avoid this obviously bad programming style now...

Apropos, why you declare string parameters but not using references to string (string& type). You have unwarranty expensive codes - that's all.

That is all for now...

Why you include readcharacter.cpp in the "other file"? It seems you don't understand the principle of a splitting a program to separate modules. Now you have ReadCharacter function body in both modules. Of course, the linker (it's a part of your programming system: linker builds exe from separately compiled modules) issues this diagnostic message. The linker does not know about line numbers: it works with compiled (object) modules.

There are many others suspicious code fragments in your code. For example:

Character InheritCharacter;//Class Declaration

Do you know that it's NOT a class declaration in C++? A class declaration is a construct started with:

class Character ... { ...

Or

... j<sizeof(Danger)/sizeof(std::string); ...

I hope you know that sizeof(std::string) is not a length of a string contents. Congratulation! You have wrote a very cryptic code: where is Danger declaration? Probably, it's a global string array declared in .h file. But if it's a pointer to dynamically allocated string array, you will have some troubles.
Now CompareThisCharm and Magic are strings.

CompMagic=Magic.compare(CompareThisCharm);
if(CompMagic == 0)

What for so mannered code? Keep it simpler:

if (Magic == CompareThisCharm)

You have a lots of global variables in numerous header files. As a result of this bad design solution it's absolutely unclear what every module must do, what's types of variables. Avoid this obviously bad programming style now...

Apropos, why you declare string parameters but not using references to string (string& type). You have unwarranty expensive codes - that's all.

That is all for now...

Well, This code does work, and as you've probably guessed, one of the first c++ projects I've done, splitting the program into modules.

Character InheritCharacter;//Class Declaration

I know this is not a class declaration...Its just slang for "I have made an instance(or whatever) of my class here"

CompMagic=Magic.compare(CompareThisCharm);
if(CompMagic == 0)

As For this, The Strings keep varying, and I could Do it the other way you mentioned, but then this is solid, and does the job anyway.

why you declare string parameters but not using references to string (string& type).

I tried using the string& type, but it doesn't compile that way, it gives a const char [some number] error, or something along those lines. I'll zip up the project, as suggested by Ancient Dragon, so you can have a look at the code.

Thanks for all your suggestions,

I'm wondering if you paid attention to arkM now since the very first sentence that he said solves your problem and it compilies, although not the best code every as pointed out.

Chris

Same thing ArkM told you a half hour ago.

The problem is that you are including readcharacter.cpp in main.cpp as if readcharacter.cpp were a header file. Never ever do that. Each *.cpp file must be compiled as if it were the only *.cpp file in the project. After the files are compiled, the compiler will link them all together.

What you need to do is remove that line #include "readcharacter.cpp" from main.cpp. After that the whole think links correctly. That doesn't mean the program is bug free -- it only means the compiler successfully compiled and linked it.

if you are getting multiple definition errors, change your headers to look like this:

#ifndef HEADERNAME_H
#define HEADERNAME_H

// Your code here

#endif

That way if you include a header more than once, it'll only be included if it hasn't been.

if you are getting multiple definition errors, change your headers to look like this:

#ifndef HEADERNAME_H
#define HEADERNAME_H

// Your code here

#endif

That way if you include a header more than once, it'll only be included if it hasn't been.

Read previous responses -- that isn't the problem.

oops sry =(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.