-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
I was able to build the project for x86 platform though. My tentative hypothesis is that, for some reason, the platform is not determined correctly by the 'if'statement at line 40 of the FindSDL2.cmake module, as the linker keeps trying to use x86 libraries. I have been using Visual Studio 16 2019 and CMake 3.19.20122902-MSVC_2. The build output is below.
Your materials have been most helpful for me as a novice in CMake. I would very much appreciate your help with this issue.
Build started...
1>------ Build started: Project: CMakeDemo, Configuration: Debug x64 ------
1>Main.obj : error LNK2019: unresolved external symbol SDL_CreateWindow referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_ShowWindow referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_DestroyWindow referenced in function "public: __cdecl AppState::~AppState(void)" (??1AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_SetAttribute referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_CreateContext referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_MakeCurrent referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_GetDrawableSize referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_SetSwapInterval referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_SwapWindow referenced in function "public: void __cdecl View::update(void)" (?update@View@@QEAAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GL_DeleteContext referenced in function "public: __cdecl AppState::~AppState(void)" (??1AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_PollEvent referenced in function SDL_main
1>Main.obj : error LNK2019: unresolved external symbol SDL_Log referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_GetTicks referenced in function SDL_main
1>Main.obj : error LNK2019: unresolved external symbol SDL_Delay referenced in function SDL_main
1>Main.obj : error LNK2019: unresolved external symbol SDL_Init referenced in function "public: __cdecl AppState::AppState(void)" (??0AppState@@QEAA@XZ)
1>Main.obj : error LNK2019: unresolved external symbol SDL_Quit referenced in function "public: __cdecl AppState::~AppState(void)" (??1AppState@@QEAA@XZ)
1>Context.obj : error LNK2019: unresolved external symbol SDL_GL_GetProcAddress referenced in function "public: void __cdecl GLFuncTable::initialize(void)" (?initialize@GLFuncTable@@QEAAXXZ)
1>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
1>..\extern\SDL2-2.0.5\lib\x86\SDL2.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
1>..\extern\SDL2-2.0.5\lib\x86\SDL2main.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
1>D:\cpp_learn\CMakeDemo\build\Debug\CMakeDemo.exe : fatal error LNK1120: 18 unresolved externals
1>Done building project "CMakeDemo.vcxproj" -- FAILED.
2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------
2>Project not selected to build for this solution configuration
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 1 skipped ==========
Metadata
Metadata
Assignees
Labels
No labels