I am using a solaris machine to run my c++ code

I have written the following code in the mentioned files

classclock.h

#include <iostream>
using namespace std;
class classclock
{
    private: 

     	int min;
        int hour;
        int sec;
     	//member function for the operations
	public:
	void SetTime(int a,int b,int c);
};

classclock.cc

#include <iostream>
using namespace std;
#include "classclock.h"

void classclock::SetTime(int a,int b,int c)
{
	if (0 < a && a < 24)
	{
		hour = a;
	}
	else {
	    hour = 0;
	}
	if (0 < b && a < 60)
	{
		min = b;
	}
	else {
	    min =0;
	}

	if (0 < c && c < 60)
	{
		sec = c;
	}
	else {
	    sec = 0;
	}
}

test.cc

#include<iostream>
using namespace std;
#include "classclock.h"


int main(){

	classclock myclock;
	myclock.SetTime(10,10,10);
        return 0;
}

I am not able to compile my test.cc and I am getting the following error:

Undefined first referenced
symbol in file
classclock::SetTime(int, int, int) /var/tmp//ccrMIpwv.o

ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status

please help!!!

Edited 6 Years Ago by Nick Evan: added code-tags

It does compiles when I move my main function inside the classclock.cc file, I believe this is because there was no main function in this .cc file, but this just compiles the code and it gives me run time error as below: please help!

using: Command not found.
: Command not found.
: Command not found.
: Command not found.
Badly placed ()'s.

@Bafna : yeah it did compile this time but it gives me the following run time error:

using: Command not found.
: Command not found.
: Command not found.
: Command not found.
Badly placed ()'s.

That does not look like a likely runtime error from the code you have posted.

Perhaps you had better post the command line you are using.

You do not invoke the output of your program with

./test.cc

That is you source file.

The output will be a.out so you would use

./a.out

as you command line

Got it!
Thanks a ton for bearing with my dumb questions :-D

In g++ -Wall -pedantic test.cc classclock.cc

What does -Wall and -pedantic options stand for?
And also as I am new to this system can you please refer me a link where I can learn more about these options?

I really appreciate your time and effort.

This article has been dead for over six months. Start a new discussion instead.