我正在嘗試“如何使用 Media Foundation 播放媒體檔案”的示例代碼,并嘗試使用以下 makefile 編譯代碼:
LDFLAGS = -LC:\\pathToWindowsSDK\\Lib\\10.0.22000.0\\um\\x64 -lMfplat -lMfuuid -lUser32 -lOle32 -lShlwapi -lMf
default: winmain.o player.o
g winmain.o player.o -o a.exe
winmain.o: winmain.cpp player.h
g winmain.cpp -c
player.o: player.cpp player.h
g player.cpp $(LDFLAGS) -c
我不斷收到以下未定義的參考:
C:/Personal/Soft/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: player.o:player.cpp:(.rdata$.refptr.GUID_NULL[.refptr.GUID_NULL] 0x0): undefined reference to `GUID_NULL'
C:/Personal/Soft/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: player.o:player.cpp:(.rdata$.refptr.MR_VIDEO_RENDER_SERVICE[.refptr.MR_VIDEO_RENDER_SERVICE] 0x0): undefined reference to `MR_VIDEO_RENDER_SERVICE'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:4: default] Error 1
兩者都是 GUID 的未定義錯誤,是否有我應該鏈接的庫?我正在使用 MSYS g 編譯器和 Windows 11 SDK (10.0.22000)。提前致謝!
uj5u.com熱心網友回復:
嘗試添加 -luuid(通過 Visual Studio 創建的 Visual C 專案默認鏈接到 uuid.lib)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/472577.html
上一篇:頂點未在opengl中讀取
下一篇:如何更改基類成員的值?
