我意識到有很多與這個問題有關的問題,但是我無法從我讀過的那些頭腦和故事中找出答案。警告:賦值使得整型指針沒有一個變量undefined
我想開始學習C爲Amiga,決定試試下面這個教程: 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;
}
我使用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,所以我想我錯過了一些明顯的東西。
通過你錯過了LockPubScreen()的正確'#include'(可能還有其他兩個)的東西,而且也沒有鏈接到定義它們的庫。 – NPE