Can someone help me with setting up build system?
Here is a link to the current status of the project.
https://github.com/ylee95/candycrush/tree/1d4b58bd4244201074d28b42d0f70bca59e3bcdd
and here is my best try for CMakeLists.txt file.
cmake_minimum_required (VERSION 2.8)
project (tamagotchi)
# SDL
add_subdirectory (SDL2-2.0.8 EXCLUDE_FROM_ALL)
target_include_directories (SDL2 PUBLIC $<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>)
set (
SOURCE_FILES
src/game.cpp
src/main.cpp
src/sdlwrapper.cpp
)
add_executable (tamagotchi ${SOURCE_FILES})
target_include_directories (tamagotchi PRIVATE src)
target_link_libraries (tamagotchi SDL2)
The issue is that this project builds fine on linux, but produces linker error on Windows.
I get the following error when I try to build this on Visual Studio 2017
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CMakeLists.txt C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\MSVCRTD.lib(exe_winmain.obj) 1