'multiple definition of' error

Hi,
I am trying to compile some of the stuff from ‘ofTutorials - Chapter 1 - Getting Started’. I declared the variables myCircleX' andmyCircleY’ in testApp.h and initialize them in testApp.cpp.

  
  
#pragma once  
  
#include "ofMain.h"  
  
int myCircleX;  
int myCircleY;  
  

This header gets invoked by testApp.cpp and main.cpp, but shouldn’t since ‘#pragma once’ is used in the header file. But apparrently something is wrong, since I got the following error message:

  
  
obj/linux64/Release/src/testApp.o:(.bss+0x10): multiple definition of `myCircleY'  
obj/linux64/Release/src/main.o:(.bss+0x10): first defined here  
obj/linux64/Release/src/testApp.o:(.bss+0x14): multiple definition of `myCircleX'  
obj/linux64/Release/src/main.o:(.bss+0x14): first defined here  
  

I also tried to compile from the terminal (instead of Code::Blocks) by the make command. Same result.
What can I do?

you need to declare the variable inside the testApp class if you declare it outside every cpp that includes it will have a copy of the variable. pragma once only avoids recursive includes but every cpp that includes a .h wil get a copy of it