Opened 10 years ago

Last modified 9 years ago

#8485 new Bugs

Compile error, same as #5431, but Windows Vista (64 bit)

Reported by: Martin.problemboost.Maurer@… Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

​https://svn.boost.org/trac/boost/ticket/5431

#ifdef _MSC_VER
/* This is Microsoft Visual C compiler specific */
#endif //_MSC_VER

Same problem with 1.51.0 and 1.53.0

Change History (12)

comment:1 by viboes, 9 years ago

Owner: changed from Anthony Williams to viboes
Status: new → assigned

I'm not sure using __MSV_VER would work. Note that it is working without this flag correctly on WINNT.

comment:2 by Martin.problemboost.Maurer@…, 9 years ago

Here the needed file to reproduce the error:

testmain.cpp

#include <intrin.h>

#include <boost/lexical_cast.hpp> #include <boost/program_options.hpp>

int main(int argc, char argv) {

printf("Hello\n");

}

I am compiling with VS2008 and 64 Bit C compiler with the following command line:

cl /openmp /favor:INTEL64 /O2 /Fetest.exe /F2097152 /TP /EHsc -I. -Id:\boost_1_53_0 testmain.cpp /link /LIBPATH:d:\boost_1_53_0\lib\x64\lib

This produces the following errors:

Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64 Copyright (C) Microsoft Corporation. All rights reserved.

testmain.cpp C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\memory(996) : error C2733: second C linkage of overloaded funct ion '_InterlockedCompareExchange_np' not allowed

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\memory(995) : see declaration of '_InterlockedCompareEx

change_np' d:\boost_1_53_0\boost/detail/interlocked.hpp(104) : error C2733: second C linkage of overloaded function '_InterlockedCompare ExchangePointer_np' not allowed

d:\boost_1_53_0\boost/detail/interlocked.hpp(104) : see declaration of '_InterlockedCompareExchangePointer_np'

When i remove the include for intrin.h it compiles and runs without problems.

comment:3 by viboes, 9 years ago

Do you have a patch?

comment:4 by viboes, 9 years ago

Description: modified (diff)

comment:5 by viboes, 9 years ago

Milestone: To Be Determined → Boost 1.54.0

comment:6 by viboes, 9 years ago

Milestone: Boost 1.54.0 → To Be Determined

I don't reach to reproduce it with msvc 10. Do you have a patch I can test?

comment:7 by viboes, 9 years ago

Component: thread → smart_ptr

In case Peter know how to fix this.

Last edited 9 years ago by viboes (previous) (diff)

comment:8 by viboes, 9 years ago

Status: assigned → new

comment:9 by viboes, 9 years ago

Owner: changed from viboes to Peter Dimov

comment:10 by Peter Dimov, 9 years ago

This is, I believe, the case in which

#include <intrin.h>
#include <utility>

int main() {}

fails. This was a problem with VC++ 8.0 but was supposed to be fixed in 9.0. There's not much we can do about this incompatibility, as it's outside our control.

comment:11 by Peter Dimov, 9 years ago

Owner: changed from Peter Dimov to Jürgen Hunold

Actually, this was fixed in VC++ 10.0, not in 9.0, and the code was correctly checking for >= 1600 (see revision [75396] and ticket #4678), but it was changed to check for 1500 in revision [80626].

comment:12 by Peter Dimov, 9 years ago

Owner: changed from Jürgen Hunold to Peter Dimov
Note: See TracTickets for help on using tickets.