0
下面的代碼鏈接錯誤LNK2019,而試圖在嘗試編譯成編譯模板聲明
#include <iostream>
#include <conio.h>
using namespace std;
template <typename T> class grid
{
public:
grid();
~grid();
void createCells();
private:
T **cells;
};
int main(int argc, char **argv)
{
grid<int> intGrid;
_getch();
return 0;
}
PROG - 得到了一個消息:
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall
grid<int>::~grid<int>(void)" ([email protected]@@[email protected]) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall
grid<int>::grid<int>(void)" ([email protected]@@[email protected]) referenced in function _main
什麼需要做什麼?
謝謝,編譯了! – zed91 2010-02-19 07:23:35