Help required to resolve LNK4086 error!
hi all,
I am trying to export some functions to a VB Application through a dll.
My dll is compiling properly.When i am building my dll ,
linker says:
Linking...
Creating library Debug/Projdll.lib and object Debug/Projdll.exp
Debug/Projdll.exe : warning LNK4086: entrypoint "_mainCRTStartup" is
not __stdcall with 12 bytes of arguments; image may not run
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Projdll.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Projdll.exe - 2 error(s), 1 warning(s)
The following in my code:
//Projdll.h
#include <windows.h>
#include <winldap.h>
#include <stdio.h>
LDAP* pLdapConnection = NULL;
ULONG version = LDAP_VERSION3;
ULONG _stdcall recConfig(char* Sname,char* domain,char* uname,char*
pword);
//Projdll.cpp
#include "ProjSrc.h"
ULONG _stdcall recConfig(char* domain,char* ip,char* uname,char* pword)
{
PCHAR pUserName = uname;
PCHAR pPassword = pword;
PCHAR hostName = ip;
PCHAR pDomainName = domain;
pLdapConnection = ldap_init(hostName, LDAP_PORT);
if (pLdapConnection == NULL)
{
printf("ldap_init failed with 0x%x.\n",LdapGetLastError());
ldap_unbind(pLdapConnection);
return -1;
}
else
{
printf("\n Initialisation successful \n");
return 0;
}
}
//Projdll.def
LIBRARY Projdll
DESCRIPTION 'export LDAPfunctions taken from Winldap.h
EXPORTS
;all variables and functions that have to be exported
recConfig
Please help me .
Thanks in advance,
Veena.