My A.cpp is
#include "A.h"
writeFile() {
cout<<"hello"<<endl;
}
and in A.h I defined writeFile as a static method.
Now in my B.cpp goes as follows:
#include "A.h";
int main() {
A::wirteFile();
}
I put all the header files and .cpp files in the same directory. When i am running it on WinNT its working
fine. But when I am running it on solaris using g++ I am getting an error.
When i say
g++ B.cpp
it gives an error undefined symbol writeFile. What can be the error? What should be the directory structure
I should follow when putting my header files and .cpp files?
Thanx in Advance
#include "A.h"
writeFile() {
cout<<"hello"<<endl;
}
and in A.h I defined writeFile as a static method.
Now in my B.cpp goes as follows:
#include "A.h";
int main() {
A::wirteFile();
}
I put all the header files and .cpp files in the same directory. When i am running it on WinNT its working
fine. But when I am running it on solaris using g++ I am getting an error.
When i say
g++ B.cpp
it gives an error undefined symbol writeFile. What can be the error? What should be the directory structure
I should follow when putting my header files and .cpp files?
Thanx in Advance