エラーメッセージは以下の通りです。
error LNK2019: 未解決の外部シンボル
エラーについて調べてみると、宣言を定義している.libがリンクされていないのが原因と書いてるのですが
コンパイルテストをしていると、templateを用いて使用するとエラーになっているみたいなので、リンクは
できているみたいです。
とりあえず、意味の無いエラー確認用のプログラムですが、アドバイスもらえるとありがたいです。
main.cpp(実行部) -------------------------------------------------- #include <iostream> #include "test.h" int main() { int d = 10; test::Flag( d ); return 0; } test.h(宣言部) ---------------------------------------------------- #pragma once namespace test { template<typename T> bool Flag( T& target ); }; test.cpp(定義部) -------------------------------------------------- #include <iostream> #include "test.h" template<typename T> bool test::Flag( T& target ) { return true; }