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

Yaron Keren via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 10 21:38:30 PST 2016


Try -DBOOST_USE_WINDOWS_H
-DBOOST_SP_USE_STD_ATOMIC may also be needed.


2016-02-11 7:19 GMT+02:00 Dennis Luehring via cfe-dev <
cfe-dev at lists.llvm.org>:

> 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?
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160211/0b3f03e0/attachment.html>


More information about the cfe-dev mailing list