N
nick
the following code is copy from a file called "abc.cpp"
i can compile it suscessfully, but an error occur when i run it
the error message is
--------------------Configuration: abc - Debug--------------------
Linking...
C:\abc.o(.text+0x59): In function `main':
C:\abc.cpp:14: undefined reference to `abc::abc()'
abc.exe - 1 error(s), 0 warning(s)
why?
thanks!
#include<iostream>
using namespace std;
class abc{
public:
abc();
void test();
};
void abc::test(){
cout<<"Testing"<<endl;
}
int main(int argc, char *argv[]){
abc a;
a.test();
return 0;
}
i can compile it suscessfully, but an error occur when i run it
the error message is
--------------------Configuration: abc - Debug--------------------
Linking...
C:\abc.o(.text+0x59): In function `main':
C:\abc.cpp:14: undefined reference to `abc::abc()'
abc.exe - 1 error(s), 0 warning(s)
why?
thanks!
#include<iostream>
using namespace std;
class abc{
public:
abc();
void test();
};
void abc::test(){
cout<<"Testing"<<endl;
}
int main(int argc, char *argv[]){
abc a;
a.test();
return 0;
}