c++ - Simple .h file troubles -


i have simple simple simple .h file

#ifndef _head #define _head  void getnextmove(char playersymbol, int &row, int &col);  #endif 

included in .cpp file #include "head.h" is included in .cpp file #include "file.cpp". keep getting error

/tmp/ccfn3b2g.o:proj1aux.cpp:(.text+0x0): multiple definition of `getnextmove(char, int&, int&)' /tmp/ccdzqlii.o:proj1.cpp:(.text+0x0): first defined here collect2: error: ld returned 1 exit status 

does know cause that? thought putting #infdef... stop repetition.

including 1 .cpp file in .cpp file advanced technique that's best avoided until thoroughly understand normal use of #include. include header files now. if errors prototype not seen function declared in file, put in header file that's included both .cpp files.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -