Hi,
ich habe ein Problem. Warum bekomme ich nen link Fehler
|
Quellcode
|
1
|
error LNK2019: unresolved external symbol "public: class WinGui::Button * __thiscall WinGui::Window::add_element<class WinGui::Button>(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,unsigned int,unsigned int,unsigned int,unsigned int,unsigned long,unsigned long (__cdecl*)(void),bool)" (??$add_element@VButton@WinGui@@@Window@WinGui@@QAEPAVButton@1@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IIIIKP6AKXZ_N@Z) referenced in function _WinMain@16)
|
wenn ich die Funktion aus ner DLL aufruf?
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
template<typename T>
T *Window::add_element (const std::wstring &Text,
unsigned int x, unsigned int y,
unsigned int Width, unsigned int Height,
unsigned long ID,
unsigned long (*command)(),
bool Ownerdraw)
{
T *pElement = new T;
if (FAIL(pElement->create (Text, x, y, Width, Height, m_Window, ID, m_Instance, command, Ownerdraw)))
return NULL;
m_Elements->push_back (reinterpret_cast<Element*>(pElement));
return pElement;
}
|
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
|
class WINGUI_API Window
{
public:
template<typename T>
T *add_element (const std::wstring &Text,
unsigned int x, unsigned int y,
unsigned int Width, unsigned int Height,
unsigned long ID,
unsigned long (*command)()=NULL,
bool Ownerdraw = false);
};
|
PS: Ja, es ist alle richtig gelinkt.