|
|
От: | Аноним | |
| Дата: | 07.06.08 19:25 | ||
| Оценка: | |||
#include "CTest.h"
int main(){
CTest t;
t.foo();
return 0;
}#ifndef T_H
#define T_H
#include <iostream>
class CTest{
public:
void foo() const;
};
#endif#include "CTest.h"
void CTest::foo() const{
std::cout << "CTest::foo()" << std::endl;
}не пойму, почему компилер не видит реализацию метода CTest::foo вынесенную в cpp файл??g++ -Wall -o "test" "test.cpp" (in directory: /home/vasya/projects/test)
/var/tmp//ccN0sL9q.o(.text+0x18): In function `main':
: undefined reference to `CTest::foo() const'
Compilation failed.