Name conflict when creating Boost libraries using Cygwin / GCC

I am in the process of migrating a C ++ application from VC ++ to GCC (works on Windows using Cygwin). My first problem is that I cannot create Boost libraries.

For example, to create Boost.Exception with VC ++, I would write:

b2 --with-exception variant=debug,release link=static runtime-link=static 

and I would get the files libboost_exception-vc100-mt-s-1_51.lib and libboost_exception-vc100-mt-sgd-1_51.lib in my stage \ lib directory.

However, when I try to use the GCC form on the Cygwin terminal, I get errors. I found out that only debugging works (or only release):

 ./b2 --with-exception variant=debug link=static runtime-link=static 

It creates libboost_exception.a in my stage \ lib directory for both cases (debug and release). Thus, there is a name conflict (the same name for the debug and release options). Is this a bug in the boost build system, or am I doing something wrong?


Edit:

Output

 ./b2 --with-exception variant=debug,release link=static runtime-link=static 

is an:

Creating Boost C ++ Libraries

/cygdrive/c/boost_1_51_0/tools/build/v2/build/virtual-target.jam:1079: in virtual-target.register-actual-name from the module virtual object

error: Duplicate name of the actual target: libboost_exception.a

error: previous virtual target {common% common.copy-libboost_exception.a.STATIC_LIB {gcc% gcc.archive-libboost_exception.a.STATIC_LIB {gcc% gcc.compile.C ++ - clone_current_exception_non_intrusive.o.OBJ {clone_ncurrent_exception CPP}}}}

error: created from. / stage -proper error: another virtual target {common% common.copy-libboost_exception.a.STATIC_LIB {gcc% gcc.archive-libboost_exception.a.STATIC_LIB {gcc% gcc.compile.C ++ - clone_current_exception_non_intrusive.o.OBJ { clone_current_exception_non_intrusive.cpp.CPP}}}}

error: created from. / stage -proper

error: added properties: off NDEBUG full shutdown speed

error: deleted properties: disabled when debugging

/cygdrive/c/boost_1_51_0/tools/build/v2/build/virtual-target.jam:490: in actualize-no-scanner from the module object (file-target) @ 1014

/cygdrive/c/boost_1_51_0/tools/build/v2/build/virtual-target.jam:135: in object(file-target)@1014.actualize from the module object (file-target) @ 1014

/cygdrive/c/boost_1_51_0/tools/build/v2/build-system.jam:749: when loading from the build-system module

/cygdrive/c/boost_1_51_0/tools/build/v2/kernel/modules.jam:283: when importing module modules

/cygdrive/c/boost_1_51_0/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from the module

/cygdrive/c/boost_1_51_0/boost-build.jam:17: in the module area from the module

+7
source share
1 answer

Although the error message is not perfect, it is an operator error. By default, the assembly uses the system name of the library — the naming you would have in your typical Unix system. So yes, if you try to create a debugging and release option, you will get a name clash.

If you add --layout=tagged or --layout=versioned to your command line, everything should work. You can run "./b2 --help" from the top directory to get some explanation for this value.

+13
source

All Articles