Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

undefined reference to fmt::*

Open
#282 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

I'm following build and install guide here: 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!

Dominant language
C++
Stars
600
Forks
114
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jinja2cpp/Jinja2Cpp

All issues in jinja2cpp/Jinja2Cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.