[gelöst] template linker Fehler



  • Ich bekomme folgenden Fehler:

    1>LaserData.obj : error LNK2001: unresolved external symbol "int __cdecl ArrayCenterPos<double>(class std::vector<double,class std::allocator<double> > &,double)" (??ArrayCenterPos@N@@YAHAAV?ArrayCenterPos@N@@YAHAAV?vector@NV?$allocator@N@std@@@std@@N@Z)

    was zu der Funktion

    template<typename T>	int ArrayCenterPos(vector<T> & InArray, T threshold);
    template<typename T>	int ArrayCenterPos(T * InArray, int size, T threshold);
    
    template<typename T>
    int ArrayCenterPos(vector<T> const & InArray, T threshold)
    {
    	return ArrayCenterPos(&InArray[0], (int)InArray.size(), threshold);
    }
    
    template<typename T>
    int ArrayCenterPos(T * InArray, int size, T threshold)
    {
    ...
    }
    

    gehört.

    Die Funktionen sind in einer header Datei die in der h Datei einer Klasse geladen wird.

    EDIT:
    Der Protoype und die Definition stimmen nicht überein (const)


Anmelden zum Antworten