Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking problem

Status
Not open for further replies.

nirs

IS-IT--Management
Apr 4, 2003
37
IL
hi
i am trying to write a dll
every thing is working great but i can't solve this linking warning.
here is the main function and the entry point to the dll

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}

but when i am trying to compile the program i get this warning:

nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in PARSERDLL.obj; second definition ignored
nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in PARSERDLL.obj; second definition ignored

i can use the force option to ignore the problem but
i prefer not to.

thank you

 
Umm it appears you have 2 entrypoints defined in 2 different files, this isn't allowed.

Check your parserdll.c (cpp?) and see if there's a DllMain in there as well
 
sory no

i searched all the files in my project and i dont have another main function

 
You are linking with MFC (nafxcwd.lib), but without compiling your DLL as an MFC extension. Go into your project settings, preprocessor options, and change _USRDLL to _AFXDLL. See this web page for more details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top