我意识到有很多与这个问题相关的问题,但我无法从我通读的那些问题中找到答案。
我正在尝试学习用于Amiga的C语言,并决定按照本教程进行尝试:http://www.pcguru.plus.com/tutorial/amiga_c.html
在这一点上,我已经遇到了菜鸟问题:
#include <proto/intuition.h>
#include <intuition/screens.h>
#include <proto/dos.h>
#include <stdio.h>
int main(void) {
struct Screen *myScreen;
if (myScreen = LockPubScreen(NULL)) {
printf("Public Screen locked.\n");
Delay(100);
UnlockPubScreen(NULL, myScreen);
printf("Public Screen unlocked.\n");
}
return 0;
}我在Shell中使用了带有以下命令的GCC编译器:
gcc -o LockPubScreen LockPubScreen.c这将返回以下内容:
Warning: assignment makes pointer from integer without a cast
undefined reference to 'LockPubScreen'
undefined reference to 'Delay'
undefined reference to 'UnlockPubScreen除了'HelloWorld‘之外,这是第一次尝试用C或编程Amiga,所以我想我遗漏了一些明显的东西。
发布于 2013-01-25 04:53:20
您可能需要包含这些附加文件中的一个或多个,以获取缺少的函数的原型:
#include <intuition/gadgetclass.h>
#include <intuition/IntuitionBase.h>
#include <libraries/gadtools.h>
#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/gadtools_protos.h>然后,正如NPE所建议的那样,如果您的编译器在缺省情况下没有包含必需的库,并且如果您没有指定它,那么可能会遇到链接错误。
发布于 2013-01-31 06:15:08
如果您提到您正在尝试在AmigaOS 4.x下编译该程序,那么答案将是显而易见的。OS4中的库函数调用也必须包含库接口-- IIntuition->LockPubScreen()、IDOS->Delay()等--或者必须在代码的开头使用#define __USE_INLINE__。
https://stackoverflow.com/questions/14510372
复制相似问题