Click here to Skip to main content
15,908,264 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Want struct parameter by default set to NULL Pin
BonshatS15-Dec-08 1:56
BonshatS15-Dec-08 1:56 
GeneralRe: Want struct parameter by default set to NULL Pin
Wischkony15-Dec-08 2:14
Wischkony15-Dec-08 2:14 
GeneralRe: Want struct parameter by default set to NULL Pin
David Crow15-Dec-08 3:12
David Crow15-Dec-08 3:12 
AnswerApologize Pin
Wischkony15-Dec-08 3:40
Wischkony15-Dec-08 3:40 
GeneralRe: Apologize Pin
Mark Salsbery15-Dec-08 11:05
Mark Salsbery15-Dec-08 11:05 
QuestionDeviceIoControl Pin
john563215-Dec-08 0:36
john563215-Dec-08 0:36 
AnswerRe: DeviceIoControl Pin
Steve Thresher15-Dec-08 4:29
Steve Thresher15-Dec-08 4:29 
QuestionUnresolved external symbol in a DLL Pin
George_George14-Dec-08 23:32
George_George14-Dec-08 23:32 
Hello everyone,

I am developing a DLL and making another console application to link with the DLL. The DLL expose type CFoo, create an instance and the application consumes it. There is error like this. The source code of DLL and main are listed below, any ideas?

1>main.obj : error LNK2001: unresolved external symbol "class CFoo foo" (?foo@@3VCFoo@@A)

foo.h (defines exposed type in the DLL)
class __declspec (dllexport) CFoo
{
public:

	CFoo();

	int foo1();

	int foo2();
};

dllmain.cpp (defines type implementation inside dll)

#include "foo.h"

CFoo::CFoo()
{
	return;
}

int CFoo::foo1()
{
	return 100;
}

int CFoo::foo2()
{
	return 200;
}

CFoo foo;

main.cpp (the console application which dynamically links with the DLL using import library)

#include "foo.h"

extern CFoo foo;

int main()
{
	int i = foo.foo1();
	i = foo.foo2();

	return 0;
}


thanks in advance,
George
AnswerRe: Unresolved external symbol in a DLL Pin
nbugalia15-Dec-08 0:45
nbugalia15-Dec-08 0:45 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 0:55
George_George15-Dec-08 0:55 
GeneralRe: Unresolved external symbol in a DLL Pin
nbugalia15-Dec-08 1:18
nbugalia15-Dec-08 1:18 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 1:54
George_George15-Dec-08 1:54 
AnswerRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 0:51
Naveen15-Dec-08 0:51 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 1:16
George_George15-Dec-08 1:16 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 1:28
Naveen15-Dec-08 1:28 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 1:59
George_George15-Dec-08 1:59 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 2:13
Naveen15-Dec-08 2:13 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 2:49
George_George15-Dec-08 2:49 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 3:14
Naveen15-Dec-08 3:14 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George16-Dec-08 1:34
George_George16-Dec-08 1:34 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen16-Dec-08 2:16
Naveen16-Dec-08 2:16 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George18-Dec-08 0:21
George_George18-Dec-08 0:21 
GeneralRe: Unresolved external symbol in a DLL Pin
Stuart Dootson16-Dec-08 3:33
professionalStuart Dootson16-Dec-08 3:33 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George18-Dec-08 0:22
George_George18-Dec-08 0:22 
GeneralRe: Unresolved external symbol in a DLL Pin
Stuart Dootson18-Dec-08 0:36
professionalStuart Dootson18-Dec-08 0:36 

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.