Hello
i am using borlan c++ 5.02 on my laptop when i try to compile my following code
// Acutall code
Code:
#include <C_CkMailMan.h>
#include <C_CkEmail.h>
#include <stdio.h>
void main()
{
HCkMailMan mailman;
BOOL success;
HCkEmail email;
const char * contentType;
// The mailman object is used for sending and receiving email.
mailman = CkMailMan_Create();
// Any string argument automatically begins the 30-day trial.
success = CkMailMan_UnlockComponent(mailman,"30-day trial");
if (success != TRUE) {
printf("Component unlock failed\n");
return;
}
// Set the SMTP server.
CkMailMan_putSmtpHost(mailman,"smtp.chilkatsoft.com");
// You may need a login/password. In many cases,
// authentication is not required when sending local email
// (i.e. to email addresses having the same domain as the
// SMTP server), but is required when sending to non-local
// recipients.
CkMailMan_putSmtpUsername(mailman,"myLogin");
CkMailMan_putSmtpPassword(mailman,"myPassword");
// Create a new email object
email = CkEmail_Create();
CkEmail_putSubject(email,"This is a test");
CkEmail_putBody(email,"This is a test");
CkEmail_putFrom(email,"Chilkat Support <[email protected]>");
CkEmail_AddTo(email,"Somebody1","[email protected]");
CkEmail_AddTo(email,"Somebody2","[email protected]");
// Add any number of attachments:
// The AddFileAttachment method can be called any number of times
// to add 1 or more attachments to an email. It returns the
// content type of the attachment added. This is for informational
// purposes only. For example, if a .jpg file is attached,
// the return string will be "image/jpeg".
// If AddFileAttachment fails (perhaps by a file-not-found error),
// a NULL reference is returned:
contentType = CkEmail_addFileAttachment(email,"c:/temp/something.doc");
if (contentType == 0 ) {
printf("%s\n",CkEmail_lastErrorText(email));
return;
}
success = CkMailMan_SendEmail(mailman,email);
if (success != TRUE) {
printf("%s\n",CkMailMan_lastErrorText(mailman));
}
else {
printf("Mail Sent!\n");
}
CkMailMan_Dispose(mailman);
CkEmail_Dispose(email);
}
it gives me followig error. i got this expample code from [url=http://www.example-code.com]
unresolver external '_main' referenced from C:\BC5\LIB\COX32.OBJ
but when i change this to void main() it gives following 16 errors. please help me
Info :Making...
Info :mail.CPP: build due to .OBJ dependency mail.CPP
Info : mail.CPP: cached age 1:57:25 PM 7/1/2011 file age 1:57:29 PM 7/1/2011
Info :Compiling C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\mail.CPP
Info :Linking C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\mail.exe
Error: Error: Unresolved external 'CkMailMan_Create()' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_UnlockComponent(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_putSmtpHost(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_putSmtpUsername(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_putSmtpPassword(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_Create()' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_putSubject(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_putBody(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_putFrom(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_AddTo(void*,const char*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_addFileAttachment(void*,const char*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_lastErrorText(void*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_SendEmail(void*,void*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_lastErrorText(void*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkMailMan_Dispose(void*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ
Error: Error: Unresolved external 'CkEmail_Dispose(void*)' referenced from C:\USERS\MEHAWK\DESKTOP\UPGRADING RECONAISSANCE\RECONAISSANCE 2.0\MAIL.OBJ