[cfe-dev] Clang debug linking options on Windows

Joshua Gerrard via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 11 13:09:09 PDT 2015


Try adding -g as a parameter to clang
On 11 Sep 2015 18:07, "Russell Wallace via cfe-dev" <cfe-dev at lists.llvm.org>
wrote:

> I'm trying to compile some code via IR and link it with the debug
> libraries on Windows, but getting errors. A minimal test case:
>
> C:\t>type a.cpp
> #define _HAS_EXCEPTIONS 0
> #include <llvm/Support/Signals.h>
>
> int main() {
>   llvm::sys::PrintStackTraceOnErrorSignal();
>   return 0;
> }
>
> C:\t>clang -I/llvm/build/include -I/llvm/include -S -emit-llvm
> -fms-compatibility-version=19 a.cpp
>
> C:\t>clang a.ll \llvm\build\Debug\lib\*.lib
> warning: overriding the module target triple with
> x86_64-pc-windows-msvc18.0.0 [-Woverride-module]
> 1 warning generated.
> LLVMSupport.lib(Signals.obj) : error LNK2038: mismatch detected for
> '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in a-db717b.o
> LLVMSupport.lib(Signals.obj) : error LNK2038: mismatch detected for
> 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value
> 'MT_StaticRelease' in a-db717b.o
> LLVMSupport.lib(Path.obj) : error LNK2038: mismatch detected for
> '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in a-db717b.o
> LLVMSupport.lib(Path.obj) : error LNK2038: mismatch detected for
> 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value
> 'MT_StaticRelease' in a-db717b.o
> LLVMSupport.lib(raw_ostream.obj) : error LNK2038: mismatch detected for
> '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in a-db717b.o
> ...etc...
>
> There's probably an option that I'm missing?
>
> _______________________________________________
> 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/20150911/7095689d/attachment.html>


More information about the cfe-dev mailing list