Skip to main content
3 votes
1 answer
260 views

There is the following C++ Core Guideline: Header files should be self-contained In large project, how can we automate this check, I would like to avoid having to add empty .cpp files for every &...
darune's user avatar
  • 11.5k
6 votes
1 answer
181 views

I am writing C++ header-only library doing some floating-point math. Since the library is header-only I realized that the library user sooner or later will include it into his project where -ffast-...
0x2207's user avatar
  • 1,052
1 vote
0 answers
147 views

I'm the author of a header-only library, which I want to make available via Conan. So, I'm writing a conanfile.py for it. The Conan documentation suggests a path for this, when your project is header ...
einpoklum's user avatar
  • 137k
2 votes
0 answers
360 views

I have three files I am compiling together using CMake (smallest example that produces the error): lib.h #ifndef lib #define lib struct StructOuter{ struct StructInner{ int a; ...
RoSv's user avatar
  • 29
0 votes
1 answer
81 views

Include paths for header-only dependencies not propagating to non-header-only library targets. cmake 3.25.3, gcc 12.2.0. I have a header-only library, let's call it foo: # foo CMakeLists.txt ...
playing4time's user avatar
1 vote
1 answer
247 views

I want to create Bindings for another programming language, and since there are hundreds of functions I am wondering how I can make things more efficient by automating or so. That means I want a list ...
BPP-DEV's user avatar
  • 31
2 votes
2 answers
2k views

There is a way of distributing C/C++ libraries as a one header-only file. Library is in one library.h file: header declarations together with implementation hidden under #ifdef LIBRARY_IMPL. You need ...
smoku's user avatar
  • 1,534
0 votes
0 answers
164 views

I am developing a library component which can be used as a template-heavy header-only library. The library has its own namespace for all the functions it exports. My problem is that the library makes ...
daedsidog's user avatar
  • 1,791
0 votes
0 answers
348 views

I am CMake newbie and trying to use it within a project of mine in order to learn it The project is a small game engine that use different external libraries such as GLFW, GLUT and SDL2. Some of them ...
GrandJagon's user avatar
5 votes
1 answer
2k views

I'm authoring a templated header only library. It has no state, no global variables, no .cpp that needs to be compiled. Is it possible to export/consume this as a module? How? What are the benefits? ...
non-user38741's user avatar
0 votes
0 answers
37 views

I have been trying to use this library in my C++ project for some time now and can't seem to figure out how to get around the issue of multiple definitions. The library contains only header files (and ...
Gabriel Bello's user avatar
1 vote
1 answer
820 views

Unsure about how to use CMake properly here. I have one library, which is a template header only library which uses C++20 features. Therefore, I want to make sure that any [downstream/consumer/...
user93114's user avatar
0 votes
1 answer
434 views

I want to use the following library https://github.com/gmeuli/caterpillar It's documentation says that it's a header-only library, and that I should "directly integrate it into my source files ...
porridgewithraisins's user avatar
5 votes
3 answers
1k views

Functions in a header-only library should be declared as inline to prevent multiple definitions in the different translation units. That is, for example, I wrote a header-only library mylib.hpp: void ...
陈浩南's user avatar
  • 683
1 vote
0 answers
593 views

I am looking for a way to reduce compile-time for header-only libraries. If there are only headers, each translation unit must compile all functions it needs, hence there is a lot of duplicate work ...
Fabian's user avatar
  • 4,261

15 30 50 per page
1
2 3 4 5
7