SDL2 2.0.4各种未定义的mingw错误引用

时间:2016-03-08 18:36:50

标签: c++ eclipse windows opengl sdl-2

我想将最新版本的SDL2用于一个小的OpenGL项目,所以我下载了SDL2的mingw开发库,并尝试使用Eclipse CDT和MinGW进行设置。但由于一些奇怪的原因,我得到了很多"未定义的引用"错误,虽然我像往常一样设置它。以下是构建控制台的输出:

g++ -std=c++0x "-IH:\\C++\\Additional\\AdditionalIncludes" "-IH:\\C++\\Additional\\AdditionalLibraries\\GLM\\glm-0.9.6.3\\glm" "-IH:\\C++\\Additional\\AdditionalLibraries\\GLEW\\glew-1.13.0\\include\\GL" "-IH:\\C++\\Additional\\AdditionalLibraries\\SDL2\\SDL2-2.0.4-OwnBuild\\include" -O2 -g3 -Wall -c -fmessage-length=0 -o main.o "..\\main.cpp" 
g++ "-LH:\\C++\\Additional\\AdditionalLibraries\\GLEW\\glew-1.13.0\\lib\\Release\\Win32" "-LH:\\C++\\Additional\\AdditionalLibraries\\SDL2\\SDL2-2.0.4-OwnBuild\\lib" -static -o "OpenGL Template.exe" main.o -lmingw32 -lSDL2 -lopengl32 -lglu32 -lglew32 -lglew32s 
h:/c++/eclipseportable/mingw/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.2.0/../../../../i686-w64-mingw32/lib/../lib\libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x39): undefined reference to `WinMain@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windows.o): In function `WIN_CoInitialize':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/core/windows/SDL_windows.c:73: undefined reference to `CoInitializeEx@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/core/windows/SDL_windows.c:75: undefined reference to `CoInitializeEx@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windows.o): In function `WIN_CoUninitialize':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/core/windows/SDL_windows.c:92: undefined reference to `CoUninitialize@0'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_SetupAPI':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:617: undefined reference to `ImmGetIMEFileNameA@12'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:630: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:633: undefined reference to `ImmReleaseContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetId':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:551: undefined reference to `ImmGetIMEFileNameA@12'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:566: undefined reference to `GetFileVersionInfoSizeA@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:570: undefined reference to `GetFileVersionInfoA@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:571: undefined reference to `VerQueryValueA@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `UIElementSink_QueryInterface@12':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1013: undefined reference to `IID_IUnknown'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IPPASink_QueryInterface@12':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1119: undefined reference to `IID_IUnknown'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `UILess_GetCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:984: undefined reference to `SysFreeString@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:683: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:687: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:691: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:692: undefined reference to `ImmReleaseContext@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:689: undefined reference to `ImmSetCompositionStringW@24'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Disable':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:364: undefined reference to `ImmAssociateContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `UIElementSink_BeginUIElement@12':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1051: undefined reference to `SysFreeString@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `UIElementSink_UpdateUIElement@8':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1078: undefined reference to `SysFreeString@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Init':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:309: undefined reference to `CoCreateInstance@20'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:323: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:324: undefined reference to `ImmReleaseContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `UILess_SetupSinks':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1192: undefined reference to `CoCreateInstance@20'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:683: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:687: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:691: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:692: undefined reference to `ImmReleaseContext@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:689: undefined reference to `ImmSetCompositionStringW@24'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetId':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:551: undefined reference to `ImmGetIMEFileNameA@12'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:566: undefined reference to `GetFileVersionInfoSizeA@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:570: undefined reference to `GetFileVersionInfoA@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetReadingString':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:423: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:498: undefined reference to `ImmReleaseContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetId':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:571: undefined reference to `VerQueryValueA@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Quit':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:378: undefined reference to `ImmAssociateContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Enable':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:349: undefined reference to `ImmAssociateContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:683: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:687: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:691: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:692: undefined reference to `ImmReleaseContext@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:689: undefined reference to `ImmSetCompositionStringW@24'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Disable':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:364: undefined reference to `ImmAssociateContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `WIN_SetTextInputRect':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:202: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:209: undefined reference to `ImmSetCompositionWindow@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:210: undefined reference to `ImmReleaseContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_HandleMessage':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:852: undefined reference to `ImmGetContext@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCompositionString':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:699: undefined reference to `ImmGetCompositionStringW@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:704: undefined reference to `ImmGetCompositionStringW@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_HandleMessage':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:890: undefined reference to `ImmReleaseContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:683: undefined reference to `ImmGetContext@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:687: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:691: undefined reference to `ImmNotifyIME@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:692: undefined reference to `ImmReleaseContext@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_HandleMessage':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:885: undefined reference to `ImmGetContext@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:767: undefined reference to `ImmGetCandidateListW@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCompositionString':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:699: undefined reference to `ImmGetCompositionStringW@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:704: undefined reference to `ImmGetCompositionStringW@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:689: undefined reference to `ImmSetCompositionStringW@24'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:771: undefined reference to `ImmGetCandidateListW@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Render':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1520: undefined reference to `CreateCompatibleDC@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1525: undefined reference to `DeleteDC@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_RenderCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1394: undefined reference to `CreatePen@12'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1395: undefined reference to `CreateSolidBrush@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1396: undefined reference to `CreatePen@12'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1397: undefined reference to `CreateSolidBrush@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1398: undefined reference to `CreatePen@12'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1399: undefined reference to `CreateSolidBrush@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1400: undefined reference to `CreateFontW@56'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1402: undefined reference to `SetBkMode@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1403: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1410: undefined reference to `GetTextExtentPoint32W@16'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `StartDrawToBitmap':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1259: undefined reference to `CreateDIBSection@24'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1261: undefined reference to `SelectObject@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_RenderCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1458: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1459: undefined reference to `SelectObject@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `DrawRect':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1285: undefined reference to `Rectangle@20'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_RenderCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1462: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1463: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1464: undefined reference to `SetTextColor@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1465: undefined reference to `SetBkMode@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1496: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1497: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1498: undefined reference to `SetTextColor@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `DrawRect':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1285: undefined reference to `Rectangle@20'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_RenderCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1502: undefined reference to `ExtTextOutW@32'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1491: undefined reference to `SelectObject@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `StopDrawToBitmap':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1270: undefined reference to `DeleteObject@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_RenderCandidateList':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1506: undefined reference to `DeleteObject@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1507: undefined reference to `DeleteObject@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1508: undefined reference to `DeleteObject@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1509: undefined reference to `DeleteObject@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowskeyboard.o):h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowskeyboard.c:1510: more undefined references to `DeleteObject@4' follow
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowsmessagebox.o): In function `WIN_ShowMessageBox':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmessagebox.c:396: undefined reference to `CreateCompatibleDC@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmessagebox.c:405: undefined reference to `CreateFontIndirectW@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmessagebox.c:409: undefined reference to `SelectObject@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmessagebox.c:413: undefined reference to `GetTextMetricsW@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmessagebox.c:428: undefined reference to `DeleteDC@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowsmessagebox.o): In function `CreateDialogData':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmessagebox.c:301: undefined reference to `GetDeviceCaps@8'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowsmouse.o): In function `WIN_CreateCursor':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmouse.c:129: undefined reference to `CreateDIBSection@24'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmouse.c:130: undefined reference to `CreateBitmap@20'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmouse.c:140: undefined reference to `DeleteObject@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsmouse.c:141: undefined reference to `DeleteObject@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowsshape.o): In function `CombineRectRegions':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsshape.c:53: undefined reference to `CreateRectRgn@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsshape.c:55: undefined reference to `CombineRgn@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowsshape.c:56: undefined reference to `DeleteObject@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowswindow.o): In function `WIN_SetWindowGammaRamp':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:606: undefined reference to `CreateDCW@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:608: undefined reference to `SetDeviceGammaRamp@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:612: undefined reference to `DeleteDC@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:612: undefined reference to `DeleteDC@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_windowswindow.o): In function `WIN_GetWindowGammaRamp':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:625: undefined reference to `CreateDCW@16'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:627: undefined reference to `GetDeviceGammaRamp@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:631: undefined reference to `DeleteDC@4'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/video/windows/SDL_windowswindow.c:631: undefined reference to `DeleteDC@4'
H:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild\lib\libSDL2.a(SDL_mmjoystick.o): In function `SDL_SYS_JoystickInit':
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/joystick/windows/SDL_mmjoystick.c:166: undefined reference to `joyGetNumDevs@0'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/joystick/windows/SDL_mmjoystick.c:171: undefined reference to `joyGetPosEx@8'
h:\C++\Additional\AdditionalLibraries\SDL2\SDL2-2.0.4-OwnBuild/src/joystick/windows/SDL_mmjoystick.c:173: undefined reference to `joyGetDevCapsA@12'

[and many more i had to cut out to post this question]

collect2.exe: error: ld returned 1 exit status

我甚至尝试使用msys shell和mingws make自己构建SDL2源代码,而且我没有libSDL2main.a文件,但显然,我不需要使用自己构建的文件SDL2的版本。但我仍然得到相同的结果。

我也在google上搜索过,但除了我之外,似乎没有人有这个问题。我忘记了什么或者我做错了什么?

顺便说一句,我也安装了glew,但我的问题似乎是特定于SDL2。这是我的所有源代码,虽然我怀疑,问题就在那里。

#include <iostream>
#include <SDL.h>
#include <glew.h>

int main(int argc, char* argv[])
{
    SDL_Init(SDL_INIT_EVERYTHING);
    std::cout << "Hello World!" << std::endl;
    SDL_Quit();
    return 0;
}

编辑:

我不明白,为什么这应该是上面链接的问题的重复,这是两个完全不同的主题!我知道,当发生这个错误时(在构建程序的链接阶段),我已经知道了,但我找不到原因,我得到了我的。

我设置SDL2应该是为了让它工作,我设置库路径并以正确的顺序指定库,因为它们必须被使用/初始化/无论如何。如果你看一下构建控制台的输出,你可以清楚地看到它。但我仍然会得到数以千计的错误,据我所知,这不应该存在。而且我不想,我必须解释一下,这个问题与上面提到的问题有什么不同,因为我认为,人们可以清楚地看到,我认为我需要解释为什么这应该是重复

0 个答案:

没有答案