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

Two WebARKitLog.h headers share the include guard WEBARKIT_LOG_H

Open Beginner friendly
#84 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, cpp
Domain
ar-vr-xr

Research direction

The two headers are include/WebARKit/WebARKitLog.h and WebARKit/include/WebARKitLog.h, and both open with the same WEBARKIT_LOG_H guard. Compare them, then check the matching implementations in lib/SRC/WebARKit/WebARKitLog.cpp and WebARKit/WebARKitLog.cpp. Done means each header has its own guard and a translation unit that includes both compiles. Pick the guard-rename fix or the convergence option with a maintainer, since the issue leaves that choice open.

Written by the indexing model from the issue text.

Description

bug C/C++ code

Description

WebARKitLib has two different logging headers with the same include guard:

header API depends on
include/WebARKit/WebARKitLog.h webarkitLOGi/e(const std::string&, …) overloads, implemented in lib/SRC/WebARKit/WebARKitLog.cpp <emscripten.h>, unconditionally
WebARKit/include/WebARKitLog.h ARUtil-style webarkitLog() with WEBARKIT_LOGd/i/w/e macros and webarkitLogLevel, implemented in WebARKit/WebARKitLog.cpp none, native-compatible

Both start with:

#ifndef WEBARKIT_LOG_H
#define WEBARKIT_LOG_H

so a translation unit that includes both gets only the first one. Code that uses the other logger then fails to compile, because its functions or macros are undeclared. The two implementations define different symbols, so they do link together.

Why it matters now

The planned ARToolKitNFTCore (webarkit/jsartoolkitNFT#683) has to compile natively, so it will log through WebARKit/include/WebARKitLog.h. The jsartoolkitNFT Embind adapters keep using include/WebARKit/WebARKitLog.h. The design works around the clash: the core includes its logger only in .cpp files, never in a public header. That is a rule to remember rather than a guarantee.

Possible fixes

  • Give each header its own guard (e.g. WEBARKIT_LOG_EM_H for the Emscripten one), or
  • make include/WebARKit/WebARKitLog.h include <emscripten.h> only under #ifdef __EMSCRIPTEN__ and converge on one logger.

Refs webarkit/jsartoolkitNFT#683.

Dominant language
C++
Stars
21
Forks
8
Avg merge
2h 59m
Merged PRs (30d)
12

Getting set up

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 webarkit/WebARKitLib

All issues in webarkit/WebARKitLib

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.