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

C / C++ / MFC

 
GeneralRe: quick question - need the registry key name which makes application to start at boot - Thanks Pin
Bill Wilson20-Mar-02 6:56
Bill Wilson20-Mar-02 6:56 
Questionmodem connection RAS or TAPI or ??? Pin
20-Mar-02 5:57
suss20-Mar-02 5:57 
AnswerI'm too Pin
dlhson20-Mar-02 6:07
dlhson20-Mar-02 6:07 
Questionhow to get a process name attached to a given udp port ? Pin
20-Mar-02 5:45
suss20-Mar-02 5:45 
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 
Hi, need a hand !

(This message is lot but really easy to read Wink | ;) )

I have a project with 2 classes. First is a normal class :

class __declspec(dllexport) Demo
{
public:
int valeur;

Demo(int x=0);
int getValue();
void setValue(int x);
};

My second class is a template :

template <class t="">
class __declspec(dllexport) Element
{
public:
T element;
public:
Element(T);
~Element();
void setElement(T);
T getElement();
};

I have an other project using those two classes. Here's the MAIN function :

#include <iostream.h>
#include "..\test_DLL\test.h"

void main()
{
Demo obj;
obj.setValue(15);
cout << obj.getValue() << endl;

Demo obj2(21);
cout << obj2.getValue() << endl;

Element<int> e1(15);
e1.setElement(15);
cout << "Valeur : " << e1.getElement() << endl;

}

Simple, right ? Here's the errors :

test.obj : error LNK2001: unresolved external symbol "public: __thiscall Element<int>::~Element<int>(void)" (??1?$Element@H@@QAE@XZ)
test.obj : error LNK2001: unresolved external symbol "public: int __thiscall Element<int>::getElement(void)" (?getElement@?$Element@H@@QAEHXZ)
test.obj : error LNK2001: unresolved external symbol "public: void __thiscall Element<int>::setElement(int)" (?setElement@?$Element@H@@QAEXH@Z)
test.obj : error LNK2001: unresolved external symbol "public: __thiscall Element<int>::Element<int>(int)" (??0?$Element@H@@QAE@H@Z)
Debug/test.exe : fatal error LNK1120: 4 unresolved externals

It seems that it cannot find the definition of those functions. It is not the path of my *.LIB of anything else since I don`t have any errors about the DEMO class. If I put the use of the class ELEMENT in commentaries, it is working fine. It seems to be related to the TEMPLATE.

Can we use templates in a DLL ? May be not after all... I`ve search the web and didn`t find any answers. Thk for taking the time to read this ! Hope somebody will help me on that one...
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 
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 

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.