```
using namespace std;

class Student{

public:

    int rollNumber;

    int age;

    static int totalStudents;

};

int Student :: totalStudents = 0;

int main() {

    cout<<Student :: totalStudents << endl;

    return 0;
} 

```

[Why do I get this error in Clion? The code seems to work fine on other online IDEs.](https://i.stack.imgur.com/YccEa.png)

Here's the error message I'm getting : 

CMakeFiles\OOPS2.dir/objects.a(Student.cpp.obj):Student.cpp:(.bss+0x0): multiple definition of `Student::totalStudents'

CMakeFiles\OOPS2.dir/objects.a(main.cpp.obj):main.cpp:(.data+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: **\* [CMakeFiles\OOPS2.dir\build.make:115: OOPS2.exe] Error 1
mingw32-make.exe[2]:**  [CMakeFiles\Makefile2:75: CMakeFiles/OOPS2.dir/all] Error 2
mingw32-make.exe[1](https://i.stack.imgur.com/YccEa.png):  **[CMakeFiles\Makefile2:82: CMakeFiles/OOPS2.dir/rule] Error 2
mingw32-make.exe: \*** [Makefile:117: OOPS2] Error 2