Assigning and using public variables in a class
<p>I have a class ABC in C++ .h class file.</p>

<p>.h file</p>

<pre><code>#ifndef ABC_H_
#define ABC_H_

class ABC
{
  public:
    int x;
    int y;
};
#endif
</code></pre>

<p>.cpp file</p>

<pre><code>//----- Empty  -----------
</code></pre>

<p>Main program .cpp</p>

<pre><code>#include &lt;iostream&gt;
#include "ABC.h"
using namespace std;
    int main() {
      ABC a1;
      a1.x=5; a1.y=2;
      cout&lt;&lt;a1.x;
      // ...
    }
</code></pre>

<p>Error during compiling in Eclipse:</p>

<pre><code>symbols not found for architecture x86_64

ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [CPPProgram] Error 1
</code></pre>

<p>All the other hello world programs etc. compile and run fine. I remember facing this error coming when I did the definition and implementation in separate files while using templates (and it went away when I implemented the definition and the implementation in same file)</p>

<p>I am not sure about what's wrong here. Any suggestions?</p>
