Sign in to follow this  

static variables name clash

Recommended Posts

So I have an exercise in my book that says: prove that file static variables in header files don't clash with each other when included in more than one cpp file.


So I have a header file that contains just: int i=10;

and 2 cpp files that include that header file.


When i try to compile->fatal error LNK1169: one or more multiply defined symbols found

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this