Click here to Skip to main content
16,011,870 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generala strange debug error Pin
Gérald Mercet20-Mar-02 5:04
Gérald Mercet20-Mar-02 5:04 
GeneralRe: a strange debug error Pin
Joaquín M López Muñoz20-Mar-02 7:34
Joaquín M López Muñoz20-Mar-02 7:34 
GeneralRe: a strange debug error Pin
Gérald Mercet21-Mar-02 3:06
Gérald Mercet21-Mar-02 3:06 
GeneralNeed HELP - Linking DLL with TEMPLATE Pin
20-Mar-02 5:04
suss20-Mar-02 5:04 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz20-Mar-02 7:30
Joaquín M López Muñoz20-Mar-02 7:30 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
20-Mar-02 10:11
suss20-Mar-02 10:11 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz20-Mar-02 10:39
Joaquín M López Muñoz20-Mar-02 10:39 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
20-Mar-02 16:53
suss20-Mar-02 16:53 
Actually, it is a template class. Here`s the code in the *.H :

template <class t=""> class __declspec(dllexport) ListeChaineSimple
{
public:
ElementSimple<t> * head;
ListeChaineSimple(T =0);
virtual ~ListeChaineSimple();
friend __declspec(dllexport) ostream& operator << (ostream&, ListeChaineSimple&);
friend __declspec(dllexport) ListeChaineSimple& operator << (ListeChaineSimple&, const T&);
friend __declspec(dllexport) ListeChaineSimple& operator >> (ListeChaineSimple&, const T&);
};

I followed your advice :

typedef ListeChaineSimple<int> LCS_int;
template __declspec(dllexport) ostream& operator<< (ostream&, LCS_int&);
template __declspec(dllexport) LCS_int& operator<< (LCS_int&, const int&);
template __declspec(dllexport) LCS_int& operator>> (LCS_int&, const int&);

Compilation is good. But running it from my application with the DLL, I'm having this error :

error LNK2001: unresolved external symbol "class ListeChaineSimple<int> & __cdecl operator>>(class ListeChaineSimple<int> &,int const &)" (??5@YAAAV?$ListeChaineSimple@H@@AAV0@ABH@Z)
error LNK2001: unresolved external symbol "class ostream & __cdecl operator<<(class ostream &,class ListeChaineSimple<int> &)" (??6@YAAAVostream@@AAV0@AAV?$ListeChaineSimple@H@@@Z)
error LNK2001: unresolved external symbol "class ListeChaineSimple<int> & __cdecl operator<<(class ListeChaineSimple<int> &,int const &)" (??6@YAAAV?$ListeChaineSimple@H@@AAV0@ABH@Z)
Debug/TP3_EXE.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.


I've made a LOT of tests... Everything is fine but this case, there`s something I`m missing. Do you know what exactly ? Thanks in avanced...
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz20-Mar-02 22:14
Joaquín M López Muñoz20-Mar-02 22:14 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
21-Mar-02 3:21
suss21-Mar-02 3:21 
GeneralRe: Need HELP - Linking DLL with TEMPLATE Pin
Joaquín M López Muñoz21-Mar-02 8:23
Joaquín M López Muñoz21-Mar-02 8:23 
Generalbmp on a dialog Pin
20-Mar-02 3:25
suss20-Mar-02 3:25 
GeneralRe: bmp on a dialog Pin
Rickard Andersson2020-Mar-02 3:31
Rickard Andersson2020-Mar-02 3:31 
GeneralRe: bmp on a dialog Pin
dlhson20-Mar-02 6:51
dlhson20-Mar-02 6:51 
Generalillegal vtable pointer Pin
albean20-Mar-02 3:23
albean20-Mar-02 3:23 
GeneralRe: illegal vtable pointer Pin
albean20-Mar-02 5:27
albean20-Mar-02 5:27 
Generalexecuting older version application in new version Pin
Bhikshapathi Gorantla20-Mar-02 3:13
Bhikshapathi Gorantla20-Mar-02 3:13 
GeneralRe: executing older version application in new version Pin
Bill Wilson20-Mar-02 6:59
Bill Wilson20-Mar-02 6:59 
GeneralRe: executing older version application in new version Pin
Bhikshapathi Gorantla20-Mar-02 18:28
Bhikshapathi Gorantla20-Mar-02 18:28 
GeneralRe: executing older version application in new version Pin
Bill Wilson21-Mar-02 5:25
Bill Wilson21-Mar-02 5:25 
GeneralIPicture Render Embedded Pin
Braulio Dez20-Mar-02 3:03
Braulio Dez20-Mar-02 3:03 
GeneralVisualStudio won't auto re-open files Pin
Steve Kearon20-Mar-02 2:51
Steve Kearon20-Mar-02 2:51 
GeneralRe: VisualStudio won't auto re-open files Pin
20-Mar-02 3:07
suss20-Mar-02 3:07 
QuestionUdp broadcast alternative? Maybe multicast? Pin
20-Mar-02 2:51
suss20-Mar-02 2:51 
GeneralCustom control Pin
kortebi20-Mar-02 2:38
kortebi20-Mar-02 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.