jinja2cpp / jinja2cpp/Jinja2Cpp

undefined reference to fmt::*

Open
#282 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
600
Forks
114
PR merge metrics
No merged PRs in 30d

Description

I'm following build and install guide [here: Link with you projects](https://jinja2cpp.github.io/docs/build_and_install.html#link-with-you-projects).
I'm building my test project using the second suggestion, Jinja2Cpp separately build and install it into system wide /usr/local path.
Test project's CMakeLists.txt is copy & paste from documentation(previous link).
main.cpp includes "jinja2cpp/template.h" and declares a template variable:
jinja2::Template tpl;

Liker complains(and few more but all are about fmtlib::fmt). E.g.:
/usr/bin/ld: /usr/local/lib/static/libjinja2cpp.a(template.cpp.o): in function `fmt::v10::detail::error_handler::on_error(char const*)':
/.../src/Jinja2Cpp/build/_deps/fmt-src/include/fmt/core.h:655:(.text._ZN3fmt3v106detail13error_handler8on_errorEPKc[_ZN3fmt3v106detail13error_handler8on_errorEPKc]+0x8): undefined reference to `fmt::v10::detail::throw_format_error(char const*)'

OS: 6.12.48+deb13-amd64
compiler: gcc 14.2.0 x86_64-linux-gnu(I saw 'supported compilers' in the readme, but still)
Unchanged CMakeLists.txt build configuration with command line: /usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ --no-warn-unused-cli -S /.../src/Jinja2Cpp -B /.../src/Jinja2Cpp/build -G Ninja

Any suggestion would be appreciated!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the build and install guide section “Link with your projects” and compare its CMakeLists.txt with the reported separately installed configuration. Reproduce the link using main.cpp and the declaration of jinja2::Template, then inspect how /usr/local/lib/static/libjinja2cpp.a exposes fmt::v10 symbols. Done means the documented setup links successfully without undefined fmt references.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.