[問題] 使用到kernel32.dll的程式該如何用gcc編譯?

看板Programming作者 (taco)時間18年前 (2007/11/08 20:10), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
請問各位該如何使用gcc編譯使用到kernel32.dll的程式(用C寫的)? 我目前的作業環境是winxp + cygwin, 程式碼中有加入#include <windows.h> 如果我單純使用MessageBox()的話編譯的過程完全沒有問題, 一旦呼叫到GetProcessID()時,編譯的時候就會出現以下錯誤訊息: $ make gcc -I. -Iinclude -o hello.exe hello.o -Wall hello.o:hello.c:(.text+0x79): undefined reference to `_GetProcessId' collect2: ld returned 1 exit status make: *** [hello.exe] Error 1 請問我該如何解決這個問題? -- ===================================== | James aka. taco -- | | War doesn't determine who's right,| | just who's left. | | Same to LIFE...?! | ===================================== -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.115.161.108
文章代碼(AID): #17CloP05 (Programming)
文章代碼(AID): #17CloP05 (Programming)