[guid] Linker Error when using precompiled headers
Hi there, there is a problem with the free flowing functions random_byte(...) and swap(...). stdafx.obj : error LNK2005: "unsigned char __cdecl boost::detail::random_byte(void)" (?random_byte@detail@boost@@YAEXZ) already defined in database.obj stdafx.obj : error LNK2005: "void __cdecl boost::swap(class boost::guid &,class boost::guid &)" (?swap@boost@@YAXAAVguid@1@0@Z) already defined in database.obj To solve that one would need to move the functions inside a structure. For example: namespace boost { namespace detail { struct utilities { static uint8_t random_byte() { ... } }; }} Christian
"Christian Henning"
Hi there, there is a problem with the free flowing functions random_byte(...) and swap(...).
I am having trouble duplicating this problem. Both functions are declaired inline which should prevent this issue. Can you provide a little more information? Andy.
stdafx.obj : error LNK2005: "unsigned char __cdecl boost::detail::random_byte(void)" (?random_byte@detail@boost@@YAEXZ) already defined in database.obj stdafx.obj : error LNK2005: "void __cdecl boost::swap(class boost::guid &,class boost::guid &)" (?swap@boost@@YAXAAVguid@1@0@Z) already defined in database.obj
To solve that one would need to move the functions inside a structure.
For example:
namespace boost { namespace detail {
struct utilities { static uint8_t random_byte() { ... } };
}}
Christian
I could bet the random_byte() was not declared as inline in the v6.
Anyway, my bad. It's working with v7, now.
Christian
On 4/5/07, Andy
"Christian Henning"
wrote in news:949801310704041433q4fcbd67ame61cc03a14742cfa@mail.gmail.com: Hi Christian,
What version are you using? The latest is guid_v7.zip.
Hi there, there is a problem with the free flowing functions random_byte(...) and swap(...).
I am having trouble duplicating this problem. Both functions are declaired inline which should prevent this issue.
Can you provide a little more information?
Andy.
stdafx.obj : error LNK2005: "unsigned char __cdecl boost::detail::random_byte(void)" (?random_byte@detail@boost@@YAEXZ) already defined in database.obj stdafx.obj : error LNK2005: "void __cdecl boost::swap(class boost::guid &,class boost::guid &)" (?swap@boost@@YAXAAVguid@1@0@Z) already defined in database.obj
To solve that one would need to move the functions inside a structure.
For example:
namespace boost { namespace detail {
struct utilities { static uint8_t random_byte() { ... } };
}}
Christian
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Andy
-
Christian Henning