hey i'm really not sure how to solve this, im making a simple "press enter to continue" function called wait(), defined it in a header file with extern keyword, and then in the main file prototyped it and from then on used it as wait();

But it still states that the object is included in other files... halp plz?

//header file definition 

extern void wait(void)
         {
          char c = getchar();
          while (c != '\n')
            c = getchar(); }

and here's tjhe main file snippet....

//main cpp file
//including stuff..


// prototype
void wait(void);

// then use as 

wait();

why doesn't this work?

wait i phrased that wrong, what it says is that the functions is already defined in other objects, which are other cpp files in the same project.... error LNK2005

if it helps this is the actual error code given to me:


1>Compiling...
1>GameCore.cpp
1>Linking...
1>CharBuilder.obj : error LNK2005: "void __cdecl wait(void)" (?wait@@YAXXZ) already defined in BatSystem.obj
1>ESpawn.obj : error LNK2005: "void __cdecl wait(void)" (?wait@@YAXXZ) already defined in BatSystem.obj
1>GameCore.obj : error LNK2005: "void __cdecl wait(void)" (?wait@@YAXXZ) already defined in BatSystem.obj
1>C:\Users\~Chaqz\Documents\Visual Studio 2008\Projects\Dragonmaster\Debug\Dragonmaster.exe : fatal error LNK1169: one or more multiply defined symbols found

I found out a way to do it myself! thanks to everyone who had a look..!

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.