[cfe-dev] Linker problems with clang on Windows using VC++ RTL andBoost

湖西Zero lifangmu at foxmail.com
Mon Oct 14 04:16:48 PDT 2013


If Your using Microsoft C++STL ,Must use driver mode cl .
 clang --driver-mode=cl or clang-cl /cl
 But clang-cl not support RIIT so ,Your must using -D_HAS_EXCEPTIONS=0 && /GR- Now;
 For example:
 If clang:
clang --driver-mode=cl -D_HAS_EXCEPTIONS=0 /GR- file.cpp
If clang-cl or cl:
clang-cl -D_HAS_EXCEPTIONS=0 /GR- file.cpp
 
------------------


 




------------------ Original ------------------
From: "Edward Diener"; 
Date: 2013年10月14日(星期一) 中午1:27
To: "Clang"; 
Subject: [cfe-dev] Linker problems with clang on Windows using VC++ RTL andBoost



I am trying to run the Boost type_traits tests using my own build of the 
latest clang on Windows under VC++, and I am getting these linker errors:

"clang-linux.link 
..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-linux-3.4\debug\add_const_test.exe

   "C:/Programming/VersionControl/bclang/bin/Release/clang.exe"    -o 
"..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-linux-3.4\debug\add_const_test.exe" 
"..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-linux-3.4\debug\add_const_test.obj" 
    -g

clang.exe: warning: argument unused during compilation: '-g'
add_const_test.obj : error LNK2019: unresolved external symbol __ZdlPv 
referenced in function __ZNSt14error_categoryD0Ev
add_const_test.obj : error LNK2019: unresolved external symbol 
___dso_handle referenced in function ___cxx_global_var_init
add_const_test.obj : error LNK2019: unresolved external symbol 
___cxa_atexit referenced in function ___cxx_global_var_init
add_const_test.obj : error LNK2019: unresolved external symbol 
__ZSt13_Winerror_mapi referenced in function 
__ZNKSt22_System_error_category7messageEi
add_const_test.obj : error LNK2019: unresolved external symbol 
__ZSt13_Syserror_mapi referenced in function 
__ZNKSt22_System_error_category23default_error_conditionEi
add_const_test.obj : error LNK2019: unresolved external symbol 
__ZSt14_Xlength_errorPKc referenced in function __ZNKSs5_XlenEv
add_const_test.obj : error LNK2019: unresolved external symbol 
___cxa_begin_catch referenced in function ___clang_call_terminate
add_const_test.obj : error LNK2019: unresolved external symbol 
__ZSt9terminatev referenced in function ___clang_call_terminate
add_const_test.obj : error LNK2019: unresolved external symbol __Znwj 
referenced in function __ZSt9_AllocateIcEPT_jS1_
add_const_test.obj : error LNK2019: unresolved external symbol 
__ZSt11_Xbad_allocv referenced in function __ZSt9_AllocateIcEPT_jS1_
add_const_test.obj : error LNK2019: unresolved external symbol 
__ZSt14_Xout_of_rangePKc referenced in function __ZNKSs5_XranEv
add_const_test.obj : error LNK2001: unresolved external symbol 
___cxa_pure_virtual
add_const_test.obj : error LNK2001: unresolved external symbol 
__ZTVN10__cxxabiv117__class_type_infoE
add_const_test.obj : error LNK2001: unresolved external symbol 
__ZTVN10__cxxabiv120__si_class_type_infoE
..\..\..\bin.v2\libs\type_traits\test\add_const_test.test\clang-linux-3.4\debug\add_const_test.exe 
: fatal error LNK1120: 14 unresolved externals
clang.exe: error: linker command failed with exit code 1120 (use -v to 
see invocation)"

Does anybody have an idea of why these errors are occurring ?

_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131014/52a26ea2/attachment.html>


More information about the cfe-dev mailing list