使用以下文件创建共享库
\n\nexample.cpp\n#include <iostream>\ntemplate <typename T>\nT Max (T & a, T & b) \n{ \n return a < b ? b:a; \n} \nRun Code Online (Sandbox Code Playgroud)\n\n我试图在我的代码中使用上面的库
\n\ntest.cpp\n#include <stdio.h>\n#include <iostream>\nusing namespace std;\n\ntemplate int Max <int> (int & a, int & b);\ntemplate double Max <double> (double & a, double & b);\n\nint main ()\n{\n int i = 39;\n int j = 20;\n cout << "Max(i, j): " << Max(i, j) << endl; \n double f1 = 13.5; \n double f2 = 20.7; \n …Run Code Online (Sandbox Code Playgroud)