c - wedit lcc-win32 中程序 "is not up to date"执行错误

标签 c windows compilation

我正在尝试使用 lcc-win32/wedit 在 c 语言中编译一个简单的 hello world 程序,并且我对 windows c 编程有点不熟悉。

#include <stdio.h>

int main(void){
 printf("hellow\n");
 return 0;
}

当我编译程序时,控制台输出是:

Wedit output window build: Tue Jun 15 09:13:17 2010

c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_RtlUnwind@16'
c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_signal'
c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_raise'
c:\lcc\lib\lcccrt0.obj .text: undefined reference to '_exit'
asctoq.obj .text: undefined reference to '_strnicmp'
defaulttrap.obj .text: undefined reference to '__imp___iob'
defaulttrap.obj .text: undefined reference to '_fwrite'
defaulttrap.obj .text: undefined reference to '_itoa'
defaulttrap.obj .text: undefined reference to '_strcat'
defaulttrap.obj .text: undefined reference to '_MessageBoxA@16'
defaulttrap.obj .text: undefined reference to '_abort'
powlasm.obj .text: undefined reference to '_pow'
qfloat.obj .text: undefined reference to '_memset'
qfloat.obj .text: undefined reference to '_strchr'
qfloat.obj .text: undefined reference to '_memmove'
strlcpy.obj .text: undefined reference to '_memcpy'
xprintf.obj .text: undefined reference to '_localeconv'
xprintf.obj .text: undefined reference to '_strtol'
xprintf.obj .text: undefined reference to '_wcslen'
xprintf.obj .text: undefined reference to '_wctomb'
xprintf.obj .text: undefined reference to '_fputc'
search
Compilation + link time:0.1 sec, Return code: 60

当我尝试在 wedit 中执行该程序时,出现一个对话框,显示“hello.exe 不是最新的。重建?”

如果我单击"is",则不会发生任何事情。如果我单击“否”,则会弹出一个 dos 窗口,显示
“C:\lcc\projects\lcc2\hello.exe”
返回码-1
执行时间0.001秒
按任意键继续...

无论我编译/重建多少次,这种情况都会继续发生。

有什么想法吗?

最佳答案

您需要告诉链接器链接 C 运行时库以及 Windows kernel32.lib 和 user32.lib 导入库。后两者需要安装Windows SDK。

您使用的编译器非常晦涩难懂。您需要阅读其手册中的小字,以了解如何正确配置它,以便链接器链接这些库。如果您无法自己解决这个问题或找到熟悉此 IDE 的人,我建议您下载免费的 Microsoft Visual Studio Express C++ 版本。它通过项目模板处理许多棘手的细节,该模板预设了许多编译器和链接器设置。您需要 Win32 控制台应用程序模板。

关于c - wedit lcc-win32 中程序 "is not up to date"执行错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3045515/

相关文章:

c - Atmel Cortex-M0+ SAMC21 在 SysTick_Config 之后挂起

c - 生成 10 个随机字符

python - 用Python编写后文件开头的奇怪字符

c++ - 为什么我从编译器得到 "expected unqualified-id before »}«"?

c++ - 共享库 C++ Makefile

ios - 如果在横向模式下 iOS 无法正常工作,则设置框架

c - 最大二进制拉伸(stretch)

windows - SQLmap 不能在 Windows XP 中的 TOR Vidalia 上工作

windows - 如何在 Windows XP 上使用批处理文件将行号添加到文本文件

c++ - 定义 NDEBUG 时删除断言是否在内联函数之前发生?