Don't include test.cpp. You were doing it correctly in the code you posted.
You need to make sure test.cpp is linked with main.cpp. How this is done depends on what IDE you're doing, but usually you just have to make sure that both cpp files are part of the project.
i dont know how i should link test.cpp with main.cpp
i have written in codeblocks
every three test.cpp test.h main.cpp is in the same directory and i have make test.h and test.cpp with codeblocks.