[Scons-users] Dependency cycles from C++ standard library headers

Andreas Gustafsson gson at gson.org
Thu Sep 14 06:11:37 EDT 2023


Hi all,

When I try to build a C++ program that includes a standard library
header of the same name as the program itself, the build fails with
a dependency cycle.  This is on a POSIX system, where executables
and C++ standard library headers both lack a filename extension.

For example, if map.cc contains:

  #include <map>
  int main(int, char **) { }

and SConstruct contains:

  Program('map', ['map.cc'])

scons fails with:

  scons: *** Found dependency cycle(s):
    map -> map.o -> map

Same thing for programs called "random", "string", "vector", etc.

Is there a way to avoid this other than renaming the program?
-- 
Andreas Gustafsson, gson at gson.org


More information about the Scons-users mailing list