Click here to Skip to main content
15,897,519 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: a question about createprocess Pin
David Crow7-Jan-04 6:44
David Crow7-Jan-04 6:44 
GeneralRe: a question about createprocess Pin
cchere7-Jan-04 9:41
cchere7-Jan-04 9:41 
GeneralRe: a question about createprocess Pin
David Crow7-Jan-04 9:45
David Crow7-Jan-04 9:45 
GeneralRe: a question about createprocess Pin
cchere7-Jan-04 10:36
cchere7-Jan-04 10:36 
GeneralRe: a question about createprocess Pin
David Crow7-Jan-04 2:54
David Crow7-Jan-04 2:54 
GeneralRe: a question about createprocess Pin
Anonymous7-Jan-04 6:10
Anonymous7-Jan-04 6:10 
GeneralPrinting Bitmaps Pin
GESY6-Jan-04 15:44
GESY6-Jan-04 15:44 
GeneralCan't import my dll functions Pin
benwestgarth6-Jan-04 15:33
benwestgarth6-Jan-04 15:33 
Hi there,
I haven't got a huge amount of experience with DLLs so go easy on me.

I have a DLL which is working fine. I need to write a .exe which calls two of the DLL's methods.

The class declaration in the header file of the DLL looks like this:
class CFaCSMenuApp : public CWinApp<br />
{<br />
public:<br />
	CFaCSMenuApp();<br />
	__declspec(dllexport) void AttachFromImanage();<br />
	DECLARE_MESSAGE_MAP()<br />
};


The .exe file looks like this:
class DllFire<br />
{<br />
public:<br />
	__declspec(dllimport) void AttachFromImanage();<br />
	DllFire();<br />
};<br />
<br />
int main()<br />
{<br />
	DllFire df;<br />
	df.AttachFromImanage();<br />
	return 0;<br />
}


When I try to compile it I get the following output:
Compiling...
Test.cpp
Linking...
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall DllFire::AttachFromImanage(void)" (__imp_?AttachFromImanage@DllFire@@QAEXXZ)
Test.obj : error LNK2001: unresolved external symbol "public: __thiscall DllFire::DllFire(void)" (??0DllFire@@QAE@XZ)
Debug/SIStarterCon.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

SIStarterCon.exe - 3 error(s), 0 warning(s)

What am I doing wrong here? I have put the .lib file created by the dll in the Object/Library modules section of the project settings.

Cheers, Ben
GeneralRe: Can't import my dll functions Pin
Anonymous6-Jan-04 15:54
Anonymous6-Jan-04 15:54 
GeneralCustom Timeline Pin
rotu6-Jan-04 14:34
rotu6-Jan-04 14:34 
GeneralChanging source url for web service Pin
Boris Russel6-Jan-04 12:58
Boris Russel6-Jan-04 12:58 
GeneralNevermind &lt;slap self&gt; Pin
Boris Russel6-Jan-04 13:12
Boris Russel6-Jan-04 13:12 
GeneralMinimizing window Pin
Anonymous6-Jan-04 12:16
Anonymous6-Jan-04 12:16 
GeneralRe: Minimizing window Pin
PJ Arends6-Jan-04 12:38
professionalPJ Arends6-Jan-04 12:38 
GeneralCFileDialog sorting/settings Pin
MaxHacker6-Jan-04 11:54
MaxHacker6-Jan-04 11:54 
GeneralRe: CFileDialog sorting/settings Pin
David Crow7-Jan-04 2:59
David Crow7-Jan-04 2:59 
GeneralRe: CFileDialog sorting/settings Pin
MaxHacker7-Jan-04 3:34
MaxHacker7-Jan-04 3:34 
GeneralRe: CFileDialog sorting/settings Pin
David Crow7-Jan-04 3:56
David Crow7-Jan-04 3:56 
Generaltrinking iterface calls mscc++ 2 g++ Pin
suiram406-Jan-04 11:39
suiram406-Jan-04 11:39 
GeneralRe: trinking iterface calls mscc++ 2 g++ Pin
suiram406-Jan-04 12:21
suiram406-Jan-04 12:21 
GeneralAnother question...MFC this time! Pin
Alberto836-Jan-04 11:35
Alberto836-Jan-04 11:35 
GeneralRe: Another question...MFC this time! Pin
Anonymous6-Jan-04 11:47
Anonymous6-Jan-04 11:47 
GeneralRe: Another question...MFC this time! Pin
Alberto836-Jan-04 20:32
Alberto836-Jan-04 20:32 
GeneralCObArray and memory fragmentation Pin
Haakon S.6-Jan-04 11:29
Haakon S.6-Jan-04 11:29 
GeneralRe: CObArray and memory fragmentation Pin
Christian Graus6-Jan-04 11:56
protectorChristian Graus6-Jan-04 11:56 

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.