iceprincefounder / ZeldaEngine

A tiny realtime Vulkan 3D engine with modern graphics, all implementations in the 📄ZeldaEngine.cpp file.
https://iceprincefounder.github.io/ZeldaEngine/
MIT License
11 stars 0 forks source link

error LNK2019: unresolved external symbol WinMain #1

Open ItsCubeTime opened 1 week ago

ItsCubeTime commented 1 week ago

Hi, wanted to take the project for a test spin :) Not really an expert with cmake, but I got this peculiar error when building ZeldaPython - not mentioning any particular src file

PS C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine> cmake .
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.38.33139.0
-- The CXX compiler identification is MSVC 19.38.33139.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using module to find Vulkan
-- Found Vulkan: C:/VulkanSDK/1.3.275.0/Lib/vulkan-1.lib (found version "1.3.275") found components: glslc glslangValidator
-- Vulkan include dir: C:/VulkanSDK/1.3.275.0/Include
-- Vulkan library dir: C:/VulkanSDK/1.3.275.0/Lib/vulkan-1.lib
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Including Win32 support
-- GLM: Version 1.0.0
-- GLM: Build with C++ features auto detection
-- No build type selected, default to Debug
-- Generating project file for example in C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaEngine/Engine/ZeldaEngine
-- Generating tool file in C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaEngine/Engine/ZeldaMeshlet
-- Generating tool file in C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaEngine/Engine/ZeldaPython
-- Generating tool file in C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaEngine/Engine/ZeldaPython
-- Configuring done (4.2s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaEngine
PS C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine> cmake --build .
MSBuild version 17.10.4+10fbfbf2e for .NET Framework

  1>Checking Build System
  Update Zelda Engine Resource Success!
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Engine/CMakeLists.txt
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): w
arning MSB8065: Custom build for item "C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprin
cefounder\ZeldaEngine\CMakeFiles\880f9780ff667a04bb60a835a0e0a527\always_rebuild.rule" succeeded, but specified output
"c:\users\olliv\desktop\art and development\render engines\zeldaengine by iceprincefounder\zeldaengine\engine\always_re
build" has not been created. This may cause incremental build to work incorrectly. [C:\Users\olliv\Desktop\Art And Deve
lopment\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Engine\ZeldaEngineShaders.vcxproj]
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glslang/glslang/CMakeLists.txt
  CodeGen.cpp
  Link.cpp
  Generating Code...
  GenericCodeGen.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\Z
  eldaEngine\Third_Party\glslang\glslang\Debug\GenericCodeGend.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glslang/glslang/OSDependent/Windows/CMakeLists.txt
  ossource.cpp
  OSDependent.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\Zeld
  aEngine\Third_Party\glslang\glslang\OSDependent\Windows\Debug\OSDependentd.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glslang/glslang/CMakeLists.txt
  cmake_pch.cxx
  glslang_tab.cpp
  attribute.cpp
  Constant.cpp
  iomapper.cpp
  InfoSink.cpp
  Initialize.cpp
  IntermTraverse.cpp
  Intermediate.cpp
  ParseContextBase.cpp
  ParseHelper.cpp
C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Third_Party\glsla
ng\glslang\MachineIndependent\ParseHelper.cpp(7539,78): warning C4267: 'argument': conversion from 'size_t' to 'int', p
ossible loss of data [C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEn
gine\Third_Party\glslang\glslang\MachineIndependent.vcxproj]
  PoolAlloc.cpp
  RemoveTree.cpp
  Scan.cpp
  ShaderLang.cpp
  SpirvIntrinsics.cpp
  SymbolTable.cpp
  Versions.cpp
  intermOut.cpp
  limits.cpp
  linkValidate.cpp
  Generating Code...
  Compiling...
  parseConst.cpp
  reflection.cpp
  Pp.cpp
  PpAtom.cpp
  PpContext.cpp
  PpScanner.cpp
  PpTokens.cpp
  propagateNoContraction.cpp
  Generating Code...
  MachineIndependent.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefound
  er\ZeldaEngine\Third_Party\glslang\glslang\Debug\MachineIndependentd.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glslang/SPIRV/CMakeLists.txt
  GlslangToSpv.cpp
  InReadableOrder.cpp
  Logger.cpp
  SpvBuilder.cpp
C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Third_Party\glsla
ng\SPIRV\SpvBuilder.cpp(1119,45): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss
of data [C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Third_Pa
rty\glslang\SPIRV\SPIRV.vcxproj]
  SpvPostProcess.cpp
  doc.cpp
  SpvTools.cpp
  disassemble.cpp
  spirv_c_interface.cpp
  Generating Code...
  SPIRV.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngin
  e\Third_Party\glslang\SPIRV\Debug\SPIRVd.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glfw/src/CMakeLists.txt
  context.c
  init.c
  input.c
  monitor.c
  platform.c
  vulkan.c
  window.c
  egl_context.c
  osmesa_context.c
  null_init.c
  null_monitor.c
  null_window.c
  null_joystick.c
  win32_module.c
  win32_time.c
  win32_thread.c
  win32_init.c
  win32_joystick.c
  win32_monitor.c
  win32_window.c
  Generating Code...
  Compiling...
  wgl_context.c
  Generating Code...
  glfw.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine
  \Third_Party\glfw\src\Debug\glfw3.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glm/glm/CMakeLists.txt
  glm.cpp
  glm.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\
  Third_Party\glm\glm\Debug\glm.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glslang/glslang/CMakeLists.txt
  glslang_c_interface.cpp
  glslang.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEng
  ine\Third_Party\glslang\glslang\Debug\glslangd.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/glslang/glslang/CMakeLists.txt
  ResourceLimits.cpp
  resource_limits_c.cpp
  Generating Code...
  glslang-default-resource-limits.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by i
  ceprincefounder\ZeldaEngine\Third_Party\glslang\glslang\Debug\glslang-default-resource-limitsd.lib
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/meshoptimizer/CMakeLists.txt
  allocator.cpp
  clusterizer.cpp
  indexcodec.cpp
  indexgenerator.cpp
  overdrawanalyzer.cpp
  overdrawoptimizer.cpp
  quantization.cpp
  simplifier.cpp
  spatialorder.cpp
  stripifier.cpp
  vcacheanalyzer.cpp
  vcacheoptimizer.cpp
  vertexcodec.cpp
  vertexfilter.cpp
  vfetchanalyzer.cpp
  vfetchoptimizer.cpp
  Generating Code...
  meshoptimizer.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\Ze
  ldaEngine\Third_Party\meshoptimizer\Debug\meshoptimizer.lib
  Generating vulkan_renderer.rc
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Engine/CMakeLists.txt
  ZeldaEngine.cpp
  GLM_GTX_hash requires C++11 standard library support
C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Engine\ZeldaEngin
e\ZeldaEngine.cpp(1622,18): warning C4101: 'iSendResult': unreferenced local variable [C:\Users\olliv\Desktop\Art And D
evelopment\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Engine\ZeldaEngine.vcxproj]
  imgui.cpp
  imgui_draw.cpp
  imgui_widgets.cpp
  imgui_tables.cpp
  imgui_impl_glfw.cpp
  imgui_impl_vulkan.cpp
  ofbx.cpp
  Generating Code...
  libdeflate.c
  ZeldaEngine.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\Zeld
  aEngine\Debug\ZeldaEngine.exe
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Engine/CMakeLists.txt
  ZeldaMeshlet.cpp
MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl in
voke_main(void)" (?invoke_main@@YAHXZ) [C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by icepri
ncefounder\ZeldaEngine\Engine\ZeldaMeshlet.vcxproj]
C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Debug\ZeldaMeshle
t.exe : fatal error LNK1120: 1 unresolved externals [C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEng
ine by iceprincefounder\ZeldaEngine\Engine\ZeldaMeshlet.vcxproj]
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Engine/CMakeLists.txt
  ZeldaPython.cpp
MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl in
voke_main(void)" (?invoke_main@@YAHXZ) [C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by icepri
ncefounder\ZeldaEngine\Engine\ZeldaPython.vcxproj]
C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\ZeldaEngine\Debug\ZeldaPython
.exe : fatal error LNK1120: 1 unresolved externals [C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngi
ne by iceprincefounder\ZeldaEngine\Engine\ZeldaPython.vcxproj]
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Engine/CMakeLists.txt
  ZeldaPythonLib.cpp
  ZeldaPythonLib.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\Z
  eldaEngine\Debug\ZeldaPythonLib.dll
  Building Custom Rule C:/Users/olliv/Desktop/Art And Development/Render Engines/ZeldaEngine by iceprincefounder/ZeldaE
  ngine/Third_Party/tinyobjloader/CMakeLists.txt
  tiny_obj_loader.cc
  tinyobjloader.vcxproj -> C:\Users\olliv\Desktop\Art And Development\Render Engines\ZeldaEngine by iceprincefounder\Ze
  ldaEngine\Third_Party\tinyobjloader\Debug\tinyobjloader.lib
ItsCubeTime commented 1 week ago

This seemed to work (open up the sln file and change the below mentioned property for ZeldaPython & ZeldaMeshlet): https://stackoverflow.com/questions/6626397/error-lnk2019-unresolved-external-symbol-winmain16-referenced-in-function#:~:text=Try%20to%20change,Console%20(/SUBSYSTEM%3ACONSOLE)

Try to change Properties -> Linker -> System -> SubSystem (in Visual Studio).

from Windows (/SUBSYSTEM:WINDOWS) to Console (/SUBSYSTEM:CONSOLE)