[cfe-dev] clang-cl error on building simple cpp with only windows.h + boost-mutex included

Dennis Luehring via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 10 21:19:18 PST 2016


Environment:
Win7 x64,
Visual Studio 2010(+ all udpates)
clang: Windows snapshot builds from http://llvm.org/builds/, Windows 
installer, based on SVN r260114 (9 February 2016).

how to reproduce:

1. download Boost 1.60 from (boost.org, 
https://sourceforge.net/projects/boost/files/boost/1.60.0/)
2. open Microsoft Visual Studio Console (for building on command line)
3. build boost with VS 2010 using this command in the boost_1_60_0 directory

b2 --toolset=msvc-10.0 --libdir=lib32-msvc-10.0 --build-dir=build_dir 
--with-thread link=static variant=release,debug threading=multi 
runtime-link=static install

4. add boost_1_60_0 directory to include path, 
boost_1_60_0\lib32-msvc-10.0 to lib path

5. try to compile with clang-cl in VS 2010
---- internal_tests.cpp
#include <boost/thread/mutex.hpp>
#include <Windows.h>

----

gives me a bunch of errors like

1>  In file included from internal_tests.cpp:2:
1>  In file included from c:\Program Files (x86)\Microsoft 
SDKs\Windows\v7.0A\include\Windows.h:156:
1>c:\Program Files (x86)\Microsoft 
SDKs\Windows\v7.0A\include\winbase.h(2635): error : conflicting types 
for 'GetProcAddress'
1>  GetProcAddress (
1>  ^
1> 
D:\projects\test\\..\boost_1_60_0\boost/thread/win32/thread_primitives.hpp(195,58) 
:  note: previous declaration is here
1>                  __declspec(dllimport) farproc_t __stdcall 
GetProcAddress(void *, const char *);
1>                                                            ^
1>  In file included from internal_tests.cpp:2:
1>  In file included from c:\Program Files (x86)\Microsoft 
SDKs\Windows\v7.0A\include\Windows.h:156:
1>c:\Program Files (x86)\Microsoft 
SDKs\Windows\v7.0A\include\winbase.h(5387): error : conflicting types 
for 'GetSystemTime'
1>  GetSystemTime(
1>  ^
........

anything i can do to get it compiled?





More information about the cfe-dev mailing list