Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Have Problem Building Current Version of Library With VS2019 #204

Open
DragonOsman opened this issue Aug 24, 2020 · 10 comments
Open

Have Problem Building Current Version of Library With VS2019 #204

DragonOsman opened this issue Aug 24, 2020 · 10 comments

Comments

@DragonOsman
Copy link

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.

@satarsa
Copy link

satarsa commented Aug 26, 2020

I have fixed it in my fork:
https://github.com/satarsa/Jinja2Cpp
I guess that a pull request here won't make any difference, thus, just use my fork.

@DragonOsman
Copy link
Author

@satarsa Thanks. I'll try it.

@AntonioCS
Copy link

@satarsa Why wouldn't it make a difference? Is this project abandoned?

@AntonioCS
Copy link

@satarsa sorry, so the issue regarding the passing of the author.

@satarsa
Copy link

satarsa commented Nov 17, 2020

@AntonioCS yes, the author died because of covid.

@AntonioCS
Copy link

@satarsa a real shame.

I noticed that you have forked the project and seem to be the one ahead of everyone in terms of development.
Are you the one that will continue the work?
I ask because I am trying to get jinja2cpp into vcpkg (with the help of the good people of #vcpkg in cpp discord).
Tried your branch and I'm getting a few errors (getting some errors with the original as well):
image

Here is my vcpkg fork: https://github.com/AntonioCS/vcpkg/tree/feature/port/jinja2cpp/ports/jinja2cpp

Here is a full list of errors: https://pastebin.com/cf14E4NB
Also you should update the dependencies in the README, all the dependencies that I have found are listed here: https://github.com/AntonioCS/vcpkg/blob/feature/port/jinja2cpp/ports/jinja2cpp/vcpkg.json#L6
Thanks

Note: I would have asked all of these things in your fork of jinja2cpp but it seems you disables the Issues tab

@satarsa
Copy link

satarsa commented Nov 18, 2020

@AntonioCS Sorry, I cannot help you. I have been using Jinja2Cpp for my very specific needs (creating text headers for crystallographic binary files). When it stopped compiling with a new version of MSVC, I came here and learned that the the project is practically abandoned. I could fix the compilation issue, but I am not intelligent enough to continue to develop or maintain the project. I did not do anything special with the Issue tab.

@AntonioCS
Copy link

@satarsa shame :(

@xmcqueen
Copy link

xmcqueen commented Mar 6, 2021

This repo is still working. I got it to compile and install and run some examples from HEAD. I did have to use a recent compiler and cmake version. Built in a docker clean room like this guy's nice writeup: https://blobfolio.com/2018/using-docker-as-a-build-environment/ (archived here http://archive.today/F5sFI). Following the directions in the README worked perfectly and the example worked, with some minor tweeks.

versions:

root@a7626eb0b94d:/mnt# gcc --version
gcc (GCC) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@a7626eb0b94d:/mnt# cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
root@a7626eb0b94d:/mnt# 

The sample code below built and linked successfully in the same dockerized clean-room like this g++ -I /mnt/include -lpthread -static-libstdc++ q.cpp /mnt/lib/static/libjinja2cpp.a:

#include <iostream>

#include <jinja2cpp/template.h>
#include <jinja2cpp/value.h>

int main() {

    std::string source = R"(
{{ ("Hello", 'world') | join }}!!!
{{ ("Hello", 'world') | join(', ') }}!!!
{{ ("Hello", 'world') | join(d = '; ') }}!!!
{{ ("Hello", 'world') | join(d = '; ') | lower }}!!!
)"; 

    jinja2::Template tpl;
    tpl.Load(source);

    std::string result = tpl.RenderAsString(jinja2::ValuesMap{}).value();

    std::cout << result;

}  

@rmorozov
Copy link
Member

rmorozov commented Aug 9, 2021

Guys, a little bit late but I've dumped deps to latest in master and it should work now with vs2019

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants