Fatal error C1083 when compiling wxWidgets on windows

https://github.com/kyledavis124/guide/tree/refactor

I am trying to add wxWidgets to my project as a subdirectory. I keep getting the errors,

"C:\Program Files (x86)\JetBrains\CLion 2021.1.3\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - NMake Makefiles" C:\Project\guide
-- cotire 1.8.0 loaded.
-- Which libraries should wxWidgets use?
    wxUSE_STL:      OFF      (use C++ STL classes)
    wxUSE_REGEX:    builtin  (enable support for wxRegEx class)
    wxUSE_ZLIB:     builtin  (use zlib for LZW compression)
    wxUSE_EXPAT:    builtin  (use expat for XML parsing)
    wxUSE_LIBJPEG:  builtin  (use libjpeg (JPEG file format))
    wxUSE_LIBPNG:   builtin  (use libpng (PNG image format))
    wxUSE_LIBTIFF:  builtin  (use libtiff (TIFF file format))
    wxUSE_LIBLZMA:  OFF      (use liblzma for LZMA compression)

-- Configured wxWidgets 3.1.5 for Windows-10.0.19043
    Min OS Version required at runtime:                Windows Vista / Windows Server 2008
    Which GUI toolkit should wxWidgets use?            msw 
    Should wxWidgets be compiled into single library?  OFF
    Should wxWidgets be linked as a shared library?    ON
    Should wxWidgets support Unicode?                  ON
    What wxWidgets compatibility level should be used? 3.0
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Project/guide/build
Problems were encountered while collecting compiler information:
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\adv\cotire\wxadv_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\aui\cotire\wxaui_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\base\cotire\wxbase_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\core\cotire\wxcore_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\gl\cotire\wxgl_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\html\cotire\wxhtml_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\media\cotire\wxmedia_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\net\cotire\wxnet_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\propgrid\cotire\wxpropgrid_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\qa\cotire\wxqa_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\ribbon\cotire\wxribbon_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\richtext\cotire\wxrichtext_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\stc\cotire\wxscintilla_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\stc\cotire\wxstc_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\webview\cotire\wxwebview_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\xml\cotire\wxxml_CXX_prefix.hxx': No such file or directory
    C:\Users\kyled\AppData\Local\Temp\compiler-file3714472391677385802: fatal error C1083: Cannot open include file: 'C:\Project\guide\build\vendor\wxwidgets\libs\xrc\cotire\wxxrc_CXX_prefix.hxx': No such file or directory

[Finished]

How would I get this to work?

cmake_minimum_required(VERSION 3.6 FATAL_ERROR)

project(guide LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(wxWidgets_ROOT_DIR ${PROJECT_SOURCE_DIR}/vendor/wxwidgets)
set(wxWidgets_LIB_DIR ${PROJECT_SOURCE_DIR}/vendor/wxwidgets/lib/vc_x64_lib)
set(wxWidgets_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/vendor/wxwidgets/include)
set(wxWidgets_CONFIGURATION msw)

add_subdirectory(vendor)
add_subdirectory(Tests)
add_subdirectory(src)


I'm sure the error has to be in the CMakeLists file. Am I forgetting something?

I'm using CMakeLists with Visual Studio 2019 compiler. My IDE is CLion. I'm on windows but this should build on all platforms.

I want to add the source code of wxWidgets as a subdirectory of my project. That way when someone checkouts my project if they don't have wxWidgets it will build it.



Read more here: https://stackoverflow.com/questions/68472992/fatal-error-c1083-when-compiling-wxwidgets-on-windows

Content Attribution

This content was originally published by Kyle Davis at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: