Ambiguous symbols possibly caused by Boost 1.69.0

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list

Hi,

 

I'm getting several instances of the following kind of error when I build my code, which does not use boost::thread, etc., as I use the STD versions:

 

1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\condition_variable(124): error C2872: 'xtime': ambiguous symbol

1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\thr\xtimec.h(18): note: could be 'xtime'

1>c:\program files\boost\boost\thread\lock_types.hpp(31): note: or       'boost::xtime'

 

My research turned up:

 

https://svn.boost.org/trac10/ticket/11477?cversion=0&cnum_hist=10

 

So I added the following value for Windows 10 to my preprocessor:

 

_WIN32_WINNT=0x0601;

 

Unfortunately, this makes no difference. Can anybody advise me of a way forward, please?

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd.

E: [hidden email]

M: +44 (0)7989 486976

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
On 27/02/2019 12:04, Tim Burgess wrote:

> I'm getting several instances of the following kind of error when I
> build my code, which does not use boost::thread, etc., as I use the STD
> versions:
>
> 1>c:\program files (x86)\microsoft visual
> studio\2017\community\vc\tools\msvc\14.16.27023\include\condition_variable(124):
> error C2872: 'xtime': ambiguous symbol
>
> 1>c:\program files (x86)\microsoft visual
> studio\2017\community\vc\tools\msvc\14.16.27023\include\thr\xtimec.h(18): note:
> could be 'xtime'
>
> 1>c:\program files\boost\boost\thread\lock_types.hpp(31): note: or      
> 'boost::xtime'

Make sure you don't have "using namespace boost;" inside any header
files (unless within method scope), and if you have it in source files,
ensure it only appears after all #includes.

(Then also follow this rule for any "using namespace" statements,
because they may eventually bite you similarly.)
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
Hi Gavin,

Just to be clear, is it just "using namespace boost;" I need to worry about,
or do I also need to strip out entries like "using namespace
boost::filesystem;"?

Best wishes.

Tim Burgess

-----Original Message-----
From: Boost-users <[hidden email]> On Behalf Of Gavin
Lambert via Boost-users
Sent: 27 February 2019 00:53
To: [hidden email]
Cc: Gavin Lambert <[hidden email]>
Subject: Re: [Boost-users] Ambiguous symbols possibly caused by Boost 1.69.0

On 27/02/2019 12:04, Tim Burgess wrote:
> I'm getting several instances of the following kind of error when I
> build my code, which does not use boost::thread, etc., as I use the
> STD
> versions:
>
> 1>c:\program files (x86)\microsoft visual
>
studio\2017\community\vc\tools\msvc\14.16.27023\include\condition_variable(1
24):
> error C2872: 'xtime': ambiguous symbol
>
> 1>c:\program files (x86)\microsoft visual
> studio\2017\community\vc\tools\msvc\14.16.27023\include\thr\xtimec.h(18):
note:
> could be 'xtime'
>
> 1>c:\program files\boost\boost\thread\lock_types.hpp(31): note: or      
> 'boost::xtime'

Make sure you don't have "using namespace boost;" inside any header files
(unless within method scope), and if you have it in source files, ensure it
only appears after all #includes.

(Then also follow this rule for any "using namespace" statements, because
they may eventually bite you similarly.)
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
On Wed, 27 Feb 2019 at 11:05, Tim Burgess via Boost-users <[hidden email]> wrote:
Hi Gavin,

Just to be clear, is it just "using namespace boost;" I need to worry about,
or do I also need to strip out entries like "using namespace
boost::filesystem;"?

"using namespace xxx" is probably a bad idea in any [if not all] case[s], if the namespace is lengthy [as they tend to be in Boost], it would be better to define a (distinctive) namespace alias.

degski
--
"Big boys don't cry" - Eric Stewart, Graham Gouldman

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Hi,

Turns out that I needed to get rid of boost::filesystem for other reasons
anyway and there were only a few instances of namespace boost - problem
solved.

Many thanks.

Best wishes.

Tim Burgess

-----Original Message-----
From: Boost-users <[hidden email]> On Behalf Of Tim
Burgess via Boost-users
Sent: 27 February 2019 09:06
To: [hidden email]
Cc: [hidden email]
Subject: Re: [Boost-users] Ambiguous symbols possibly caused by Boost 1.69.0

Hi Gavin,

Just to be clear, is it just "using namespace boost;" I need to worry about,
or do I also need to strip out entries like "using namespace
boost::filesystem;"?

Best wishes.

Tim Burgess

-----Original Message-----
From: Boost-users <[hidden email]> On Behalf Of Gavin
Lambert via Boost-users
Sent: 27 February 2019 00:53
To: [hidden email]
Cc: Gavin Lambert <[hidden email]>
Subject: Re: [Boost-users] Ambiguous symbols possibly caused by Boost 1.69.0

On 27/02/2019 12:04, Tim Burgess wrote:
> I'm getting several instances of the following kind of error when I
> build my code, which does not use boost::thread, etc., as I use the
> STD
> versions:
>
> 1>c:\program files (x86)\microsoft visual
>
studio\2017\community\vc\tools\msvc\14.16.27023\include\condition_variable(1
24):
> error C2872: 'xtime': ambiguous symbol
>
> 1>c:\program files (x86)\microsoft visual
> studio\2017\community\vc\tools\msvc\14.16.27023\include\thr\xtimec.h(18):
note:
> could be 'xtime'
>
> 1>c:\program files\boost\boost\thread\lock_types.hpp(31): note: or      
> 'boost::xtime'

Make sure you don't have "using namespace boost;" inside any header files
(unless within method scope), and if you have it in source files, ensure it
only appears after all #includes.

(Then also follow this rule for any "using namespace" statements, because
they may eventually bite you similarly.)
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On 27.02.2019 16:53, degski via Boost-users wrote:
On Wed, 27 Feb 2019 at 11:05, Tim Burgess via Boost-users <[hidden email]> wrote:
Hi Gavin,

Just to be clear, is it just "using namespace boost;" I need to worry about,
or do I also need to strip out entries like "using namespace
boost::filesystem;"?

"using namespace xxx" is probably a bad idea in any [if not all] case[s], if the namespace is lengthy [as they tend to be in Boost], it would be better to define a (distinctive) namespace alias.

They are a particularly bad idea in public header files.

Best regards,

Leon



_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list

OK, noted. Must admit the project I’ve been working on has made me a little wiser, even if a lot older😊

 

Best wishes.

 

Tim Burgess

 

From: Boost-users <[hidden email]> On Behalf Of Leon Mlakar via Boost-users
Sent: 27 February 2019 15:59
To: degski via Boost-users <[hidden email]>
Cc: Leon Mlakar <[hidden email]>
Subject: Re: [Boost-users] Ambiguous symbols possibly caused by Boost 1.69.0

 

On 27.02.2019 16:53, degski via Boost-users wrote:

On Wed, 27 Feb 2019 at 11:05, Tim Burgess via Boost-users <[hidden email]> wrote:

Hi Gavin,

Just to be clear, is it just "using namespace boost;" I need to worry about,
or do I also need to strip out entries like "using namespace
boost::filesystem;"?

 

"using namespace xxx" is probably a bad idea in any [if not all] case[s], if the namespace is lengthy [as they tend to be in Boost], it would be better to define a (distinctive) namespace alias.

They are a particularly bad idea in public header files.

Best regards,

Leon

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
On Wed, 27 Feb 2019 at 18:01, Tim Burgess via Boost-users <[hidden email]> wrote:

OK, noted. Must admit the project I’ve been working on has made me a little wiser, even if a lot older😊


Next step, don't top-post (there's a link somewhere [on Boost.org] about this, but I don't have it)!

degski
--
"Big boys don't cry" - Eric Stewart, Graham Gouldman

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list

Next step, don't top-post (there's a link somewhere [on Boost.org] about this, but I don't have it)!

TB: It’s here and I take the ppoint:

 

https://www.boost.org/community/policy.html#quoting


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
On Wed, 27 Feb 2019 at 18:12, Tim Burgess via Boost-users <[hidden email]> wrote:

Next step, don't top-post (there's a link somewhere [on Boost.org] about this, but I don't have it)!

TB: It’s here and I take the ppoint:

 

https://www.boost.org/community/policy.html#quoting


No worries. I'm an avid follower of the cfe-dev list, because that [Clang] is what I use on a daily basis. They don't follow this rule [and only top-post], and it's an absolute horror to read the mailing list. They [the Clang devs] don't seem to mind. I'm not in any position to tell them to sanitize their posing habits [because I've got nothing to contribute to Clang], so I put up with it, but it's a pain in the proverbial behind. I'm happy Boost does much better.

degski
--
"Big boys don't cry" - Eric Stewart, Graham Gouldman

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Ambiguous symbols possibly caused by Boost 1.69.0

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On 27/02/2019 22:05, Tim Burgess wrote:
> Just to be clear, is it just "using namespace boost;" I need to worry about,
> or do I also need to strip out entries like "using namespace
> boost::filesystem;"?

"using namespace boost" is the only one that would cause that specific
error (when used before some CRT #include), but as I did say:

>> (Then also follow this rule for any "using namespace" statements, because
>> they may eventually bite you similarly.)

you should avoid it in general.

"using namespace" is a shotgun; you need to be careful both of what
you're pointing it at, as well as where you're standing when you do so.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users