Skip to content

Have Problem Building Current Version of Library With VS2019 #204

Open
@DragonOsman

Description

@DragonOsman

I ran CMake on the command line with this command:

cmake .. -DCMAKE_INSTALL_PREFIX=../install -G "Visual Studio 16 2019" -A x64 -DCMAKE_CXX_STANDARD=17 -DJINJA2CPP_CXX_STANDARD=17 -DJINJA2CPP_DEPS_MODE=external-boost -DJINJA2CPP_MSVC_RUNTIME_TYPE=/MT -DCMAKE_CXX_FLAGS=/EHsc -DCMAKE_BUILD_TYPE=Release

and had this output:

-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- Jinja2Cpp C++ standard: 17
-- Selected MSVC runtime type for Jinja2C++ library: '/MT'
-- Jinja2C++ library type: STATIC
-- Selected Jinja2C++ thirdparty libraries runtime type: '/MT'
-- 'extnernal-boost' dependencies mode selected for Jinja2Cpp. All dependencies are used as submodules except of boost
-- Project 'expected_lite', package 'expected-lite' version: '0.3.0'
-- Project 'variant_lite', package 'variant-lite' version: '1.2.2'
-- Project 'optional_lite', package 'optional-lite' version: '3.2.0'
-- Project 'string_view_lite', package 'string-view-lite' version: '1.3.0'
-- Version: 6.1.2
-- Build type: Release
-- CXX_STANDARD: 17
CMake Warning (dev) at thirdparty/json/rapid/CMakeLists.txt:12 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    PROJECT_VERSION
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

-- RapidJSON found. Headers: C:/Jinja2Cpp/thirdparty/json/rapid/include
-- Using the multi-header code from C:/Jinja2Cpp/thirdparty/json/nlohmann/include/
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (GTest) does
  not match the name of the calling package (gtest).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.18/Modules/FindGTest.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  thirdparty/CMakeLists.txt:47 (find_package)
  CMakeLists.txt:172 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- gtest not found, using submodule
-- infix: EXPECTED-LITE target: expected-lite
-- infix: VARIANT-LITE target: variant-lite
-- infix: OPTIONAL-LITE target: optional-lite
-- infix: STRING-VIEW-LITE target: string-view-lite
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Jinja2Cpp/build

Then when I tried to build it, I had some errors:

cmake --build . --target all_build --config Release
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Jinja2Cpp/CMakeLists.txt
  Building Custom Rule C:/Jinja2Cpp/CMakeLists.txt
  error_info.cpp
  expression_evaluator.cpp
  expression_parser.cpp
  filesystem_handler.cpp
  filters.cpp
  internal_value.cpp
  lexer.cpp
  rapid_json_serializer.cpp
  serialize_filters.cpp
  statements.cpp
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1464,1): error C2039: 'type': is not a member
of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(151): messa
ge : see declaration of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(819): messa
ge : see reference to class template instantiation 'nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImp
l<char>>,jinja2::ErrorInfo>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to class template instantiation 'std::is_trivially_destructible<nonstd::expected_lite::expected<std::sha
red_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to variable template 'const bool conjunction_v<std::is_trivially_destructible<jinja2::EmptyValue>,std::i
s_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char> >,jinja2::ErrorInfo
Tpl<char> > >,std::is_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar
_t> >,jinja2::ErrorInfoTpl<wchar_t> > > >' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(1011): message
: see reference to alias template instantiation 'std::_Variant_destroy_layer<jinja2::EmptyValue,nonstd::expected_lite::
expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expected_lite::expected<std::shared_ptr
<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(275): message : see reference to class template instantiation 'std::variant<jinja2::Em
ptyValue,nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expecte
d_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\buil
d\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(398): message : see reference to class template instantiation 'jinja2::TemplateImpl<Ch
arT>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,1): error C3646: 'swap': unknown override
 specifier [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,9): error C2059: syntax error: '(' [C:\Ji
nja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1474,1): error C2334: unexpected token(s) prec
eding '{'; skipping apparent function body [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
  string_converter_filter.cpp
  template.cpp
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1464,1): error C2039: 'type': is not a member
of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(151): messa
ge : see declaration of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(819): messa
ge : see reference to class template instantiation 'nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImp
l<char>>,jinja2::ErrorInfo>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to class template instantiation 'std::is_trivially_destructible<nonstd::expected_lite::expected<std::sha
red_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to variable template 'const bool conjunction_v<std::is_trivially_destructible<jinja2::EmptyValue>,std::i
s_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char> >,jinja2::ErrorInfo
Tpl<char> > >,std::is_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar
_t> >,jinja2::ErrorInfoTpl<wchar_t> > > >' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(1011): message
: see reference to alias template instantiation 'std::_Variant_destroy_layer<jinja2::EmptyValue,nonstd::expected_lite::
expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expected_lite::expected<std::shared_ptr
<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(275): message : see reference to class template instantiation 'std::variant<jinja2::Em
ptyValue,nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expecte
d_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\buil
d\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(398): message : see reference to class template instantiation 'jinja2::TemplateImpl<Ch
arT>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,1): error C3646: 'swap': unknown override
 specifier [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,9): error C2059: syntax error: '(' [C:\Ji
nja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1474,1): error C2334: unexpected token(s) prec
eding '{'; skipping apparent function body [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
  template_env.cpp
  template_parser.cpp
  testers.cpp
  value.cpp
  Generating Code...
  Building Custom Rule C:/Jinja2Cpp/thirdparty/gtest/googletest/CMakeLists.txt
  gtest-all.cc
  gtest.vcxproj -> C:\Jinja2Cpp\build\thirdparty\gtest\googlemock\gtest\Release\gtest.lib
  Building Custom Rule C:/Jinja2Cpp/thirdparty/gtest/googletest/CMakeLists.txt
  gtest_main.cc
  gtest_main.vcxproj -> C:\Jinja2Cpp\build\thirdparty\gtest\googlemock\gtest\Release\gtest_main.lib

I also tried building INSTALL.vcxproj after this since it seemed like some stuff got built, but no dice. It didn't even create a folder called "install". Build result:

cmake --build . --target install --config Release
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  statements.cpp
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1464,1): error C2039: 'type': is not a member
of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(151): messa
ge : see declaration of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(819): messa
ge : see reference to class template instantiation 'nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImp
l<char>>,jinja2::ErrorInfo>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to class template instantiation 'std::is_trivially_destructible<nonstd::expected_lite::expected<std::sha
red_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to variable template 'const bool conjunction_v<std::is_trivially_destructible<jinja2::EmptyValue>,std::i
s_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char> >,jinja2::ErrorInfo
Tpl<char> > >,std::is_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar
_t> >,jinja2::ErrorInfoTpl<wchar_t> > > >' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(1011): message
: see reference to alias template instantiation 'std::_Variant_destroy_layer<jinja2::EmptyValue,nonstd::expected_lite::
expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expected_lite::expected<std::shared_ptr
<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(275): message : see reference to class template instantiation 'std::variant<jinja2::Em
ptyValue,nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expecte
d_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\buil
d\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(398): message : see reference to class template instantiation 'jinja2::TemplateImpl<Ch
arT>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,1): error C3646: 'swap': unknown override
 specifier [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,9): error C2059: syntax error: '(' [C:\Ji
nja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1474,1): error C2334: unexpected token(s) prec
eding '{'; skipping apparent function body [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
  template.cpp
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1464,1): error C2039: 'type': is not a member
of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(151): messa
ge : see declaration of 'std::enable_if<false,void>' [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(819): messa
ge : see reference to class template instantiation 'nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImp
l<char>>,jinja2::ErrorInfo>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to class template instantiation 'std::is_trivially_destructible<nonstd::expected_lite::expected<std::sha
red_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(956): message :
 see reference to variable template 'const bool conjunction_v<std::is_trivially_destructible<jinja2::EmptyValue>,std::i
s_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char> >,jinja2::ErrorInfo
Tpl<char> > >,std::is_trivially_destructible<nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar
_t> >,jinja2::ErrorInfoTpl<wchar_t> > > >' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\variant(1011): message
: see reference to alias template instantiation 'std::_Variant_destroy_layer<jinja2::EmptyValue,nonstd::expected_lite::
expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expected_lite::expected<std::shared_ptr
<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(275): message : see reference to class template instantiation 'std::variant<jinja2::Em
ptyValue,nonstd::expected_lite::expected<std::shared_ptr<jinja2::TemplateImpl<char>>,jinja2::ErrorInfo>,nonstd::expecte
d_lite::expected<std::shared_ptr<jinja2::TemplateImpl<wchar_t>>,jinja2::ErrorInfoW>>' being compiled [C:\Jinja2Cpp\buil
d\jinja2cpp.vcxproj]
C:\Jinja2Cpp\src\template_impl.h(398): message : see reference to class template instantiation 'jinja2::TemplateImpl<Ch
arT>' being compiled [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,1): error C3646: 'swap': unknown override
 specifier [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1469,9): error C2059: syntax error: '(' [C:\Ji
nja2Cpp\build\jinja2cpp.vcxproj]
C:\Jinja2Cpp\thirdparty\nonstd\expected-lite\include\nonstd/expected.hpp(1474,1): error C2334: unexpected token(s) prec
eding '{'; skipping apparent function body [C:\Jinja2Cpp\build\jinja2cpp.vcxproj]
  Generating Code...
  gtest.vcxproj -> C:\Jinja2Cpp\build\thirdparty\gtest\googlemock\gtest\Release\gtest.lib
  gtest_main.vcxproj -> C:\Jinja2Cpp\build\thirdparty\gtest\googlemock\gtest\Release\gtest_main.lib

Any help is appreciated. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions