Hello,

I pass -municode in add_definitions but GCC still complains about the
wrong type on WinMain, citing it needs an LPSTR argument. With
-municode set it should require a LPWSTR and should be named wWinMain.
If I name the function wWinMain the linker complains about a missing
WinMain, which makes no sense. This works when I create a Makefile
myself.

CMakeLists.txt as follows.

cmake_minimum_required (VERSION 3.5)
project (mtktool)

list (
  APPEND
  CMAKE_MODULE_PATH
  "${CMAKE_CURRENT_LIST_DIR}/cmake"
)

set (mtktool_VERSION_MAJOR 0)
set (mtktool_VERSION_MINOR 0)
set (mtktool_VERSION_PATCH 0)

configure_file (
  "${PROJECT_SOURCE_DIR}/config.h.in"
  "${PROJECT_SOURCE_DIR}/config.h"
)

include_directories (
  "${CMAKE_CURRENT_SOURCE_DIR}"
)

add_definitions (
  -municode
  -mwindows
)

add_executable (
  mtktool
  mtktool.c
)

Cheers,
     R0b0t1
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to