I'm learning C++ and using CLion to build projects. I have the main.cpp file in the main directory. I also have a main/Objects directory, inside of which I have Vec3.h and Vec3.cpp files:
//Vec3.h
template<typename T>
class Vec3
{
public:
    // 3 most basic ways of initializing a vector
    Vec3() : x(T(0)), y(T(0)), z(T(0)) {}
    Vec3(const T &xx) : x(xx), y(xx), z(xx) {}
    Vec3(T xx, T yy, T zz) : x(xx), y(yy), z(zz) {}
    T x, y, z;
    T length();
};
.
//Vec3.cpp
#include "Vec3.h"
#include <stdio.h>
#include <math.h>
template <typename T>
T Vec3<T>::length()
{
    return sqrt(x * x + y * y + z * z);
}
.
//main.cpp
#include <iostream>
#include "Objects/Vec3.h"
int main() {
    Vec3<double> vec(3, 4, 0);
    std::cout << "Hello, World!" << std::endl;
    std::cout << vec.length() << std::endl;
    return 0;
}
.
//CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
project(Testing)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp Objects/Vec3.cpp)
add_executable(Testing ${SOURCE_FILES})
When I try to build and run, I get the following error:
undefined reference to "Vec3<double>::length()". ld returned 1 exit status
What info am I not giving to the linkeditor?
 
    