- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
#include <CkMailMan.h>
#include <CkEmail.h>
#include <stdio>
void ChilkatSample(void)
{
// The mailman object is used for sending and receiving email.
CkMailMan mailman;
// Any string argument automatically begins the 30-day trial.
bool success;
success = mailman.UnlockComponent("30-day trial");
if (success != true) {
printf("%s\n",mailman.lastErrorText());
return;
}
// Set the SMTP server.
mailman.put_SmtpHost("smtp.chilkatsoft.com");
// Set the SMTP login/password (if required)
mailman.put_SmtpUsername("myUsername");
mailman.put_SmtpPassword("myPassword");
// Create a new email object
CkEmail email;
email.put_Subject("This is a test");
email.put_Body("This is a test");
email.put_From("Chilkat Support <support@chilkatsoft.com>");
email.AddTo("Chilkat Admin","admin@chilkatsoft.com");
// To add more recipients, call AddTo, AddCC, or AddBcc once per recipient.
// Call SendEmail to connect to the SMTP server and send.
// The connection (i.e. session) to the SMTP server remains
// open so that subsequent SendEmail calls may use the
// same connection.
success = mailman.SendEmail(email);
if (success != true) {
printf("%s\n",mailman.lastErrorText());
return;
}
// Some SMTP servers do not actually send the email until
// the connection is closed. In these cases, it is necessary to
// call CloseSmtpConnection for the mail to be sent.
// Most SMTP servers send the email immediately, and it is
// not required to close the connection. We'll close it here
// for the example:
success = mailman.CloseSmtpConnection();
if (success != true) {
printf("Connection to SMTP server not closed cleanly.\n");
}
printf("Mail Sent!\n");
}
我尝试使用 Chilkat 库发送 STMP 邮件。我收到错误:“未解析从 C0X32.OBJ 引用的外部‘_main’。”
最佳答案
您需要一个 main()
函数,它是(托管)实现的 C 入口点。
它可能就像添加一样简单:
int main (void) {
ChilkatSample();
return 0;
}
您的代码,否则它可能会更加复杂。
但最重要的是,您的实现启动代码(在 C0X32.OBJ
中)正在尝试查找 main
,以便它可以开始正确运行您的程序。
此外,如果您在 stdio
header 之后,则应该使用:
#include <stdio.h>
而不是像现在一样放弃扩展。
关于c++ - 从 C0X32.OBJ 引用的未解析的外部 '_main',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24669513/
我使用 visual studio 2013 在 C 中编写程序,但出现此错误:MSVCRTD.lib(crtexe.obj):错误 LNK2019:函数 ___tmainCRTStartup 中引用
每当我尝试编译由 Appcelerator Titanium 生成的任何 iPhone 应用程序时,我都会在 Snow Leopard 10.6.2 上的 Xcode 3.2.1 中收到以下错误。但是
我有一个包含两个项目的解决方案 其中一个是控制台应用程序,另一个是Google Test项目 我的项目中有一个.h文件和一个带有main()的.CPP文件 我的gtest包含一个.CPP文件,该文件使
我正在尝试从最小的 Python 文件生成二进制文件: print 'hello' 使用此 makefile: #!/usr/bin/make -f export flags= cflags=$(fl
我一直在尝试将当前操作系统项目的大部分从 x86 汇编转换为 C,并使用 NASM 进行汇编并使用 MinGW 进行编译。链接时,我收到以下错误: ld: warning: cannot find e
我是编程新手,我正在复习 vector 的基础知识。我目前在运行此程序时遇到错误“链接器命令失败,退出代码为 1(使用 -v 请参阅调用)” 现在我已经看到了这方面的帖子,但我运行的 Xcode 显然
我在程序/游戏的主函数中调用了三个函数时遇到问题:initEnemy、drawEnemy 和 updateEnemy。每个在运行时都附有此错误:“错误 LNK2019:未解析的外部符号“...”在函数
当我尝试使用模板编译我的程序时出现一些链接器错误: GCD.h #include // allows program to perform input and output using namesp
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
我可以分别编译我的两个文件 serveur.c 和 client.c,但是当我尝试使用 makefile 时,它显示错误。我想要的很简单:两个编译文件:serveur.o 和 client.o。
我是 C 编程的新手,我正在编写一个程序,它开始抛出以下错误: error LNK2019 unresolved external symbol_printf referenced in functi
我不断收到此错误“_main”,引用自:...”我是C++的新手,Xcode可以向我解释为什么我收到此错误,以及需要怎么做才能解决它? 谢谢 #ifndef bank_h #define bank_h
#include #include #include void ChilkatSample(void) { // The mailman object is used for send
当我尝试编译我的 C++ 控制台应用程序时,我一直收到此错误:“函数 __tmainCRTStartup 中引用了未解析的外部符号 main”。我做了一些搜索,我所能找到的只是将我的“链接器”从 Wi
我有一些 C++ 代码。 鸟.h class Bird { std::string s; static int i; public: Bird(); ~Bird();
我目前正在尝试在 IOS 上编译一个基于 QT 的项目。我正在使用 cmake 创建和配置 .xcodeproject 和 xcode 以在设备上运行应用程序。 我成功地消除了所有先前的链接器错误,现
我正在尝试将我的 iOS 应用程序转换为 Swift。一切都很顺利,直到我尝试用 .swift 等效项替换我的 AppDelegate.m/.h。现在,在构建时,出现以下错误: Ld /Users/r
以下代码结构: 数组堆栈.h #ifndef ARRAY_STACK_H #define ARRAY_STACK_H #include "Array.h" // class ArrayStack #e
我这辈子都找不到解决办法!我正在使用 swift 。突然间我得到了这个错误: Undefined symbols for architecture i386: "_main", reference
我有以下错误: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 有很多与此错误相
我是一名优秀的程序员,十分优秀!