<div dir="ltr"><div><div><div><div><div>Hey, <br><br>I have an issue while trying to link some clang compiled code. When I compile my test dll with clang I get a 
new operator like this:<br>
<br>__Znwj<br><br></div><div>I guess this is conformant with GCC's naming.<br></div><div><br></div>But when compiling with visual studio the new operator is:<br><br>Searching libraries<br>    Searching C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB\MSVCRTD.lib:<br>

      Found __purecall<br>        Referenced in ConsoleApplication2.obj<br>        Loaded MSVCRTD.lib(MSVCR110D.dll)<br>      Found "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)<br>        Referenced in ConsoleApplication2.obj<br>

        Loaded MSVCRTD.lib(MSVCR110D.dll)<br>      Found "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)<br>        Referenced in ConsoleApplication2.obj<br>        Loaded MSVCRTD.lib(MSVCR110D.dll)<br><br>

</div>I also noticed that with Clang I get a symbol for pure call catches called:<br>___cxa_pure_virtual<br><br></div>I assume the __purecall above is the visual studio version. <br><br></div>When I try to link the clang compiled object file using link.exe I get unresolved symbol errors because of this. <br>

<br>F:\LLVM-fresh\vs11\bin\Debug>clang++ -c testdll.cpp -o testdll.o -v<br>clang version 3.5 (trunk)<br>Target: i686-pc-win32<br>Thread model: posix<br> "F:\LLVM-fresh\vs11\bin\Debug\clang++.exe" -cc1 -triple i686-pc-win32 -emit-obj<br>

 -mrelax-all -disable-free -main-file-name testdll.cpp -mrelocation-model static<br> -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu<br>pentium4 -v -coverage-file "F:\\LLVM-fresh\\vs11\\bin\\Debug\\testdll.o" -resour<br>

ce-dir "F:\\LLVM-fresh\\vs11\\bin\\Debug\\..\\lib\\clang\\3.5" -internal-isystem<br> "F:\\LLVM-fresh\\vs11\\bin\\Debug\\..\\lib\\clang\\3.5\\include" -internal-isys<br>tem "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE" -intern<br>

al-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\I<br>NCLUDE" -internal-isystem "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.<br>0A\\include" -std=c++11 -fdeprecated-macro -fdebug-compilation-dir "F:\\LLVM-fre<br>

sh\\vs11\\bin\\Debug" -ferror-limit 19 -fmessage-length 80 -mstackrealign -fms-e<br>xtensions -fms-compatibility -fmsc-version=1700 -fdelayed-template-parsing -fobj<br>c-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-di<br>

agnostics -vectorize-slp -o testdll.o -x c++ testdll.cpp<br>clang -cc1 version 3.5 based upon LLVM 3.5svn default target i686-pc-win32<br>#include "..." search starts here:<br>#include <...> search starts here:<br>

 F:\LLVM-fresh\vs11\bin\Debug\..\lib\clang\3.5\include<br> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE<br> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE<br> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include<br>

End of search list.<br><br>F:\LLVM-fresh\vs11\bin\Debug>nm testdll.o<br>00000000 t .text<br>00000000 t .text<br>00000001 a @feat.00<br>00000000 T __ZN7testOneC2Ev<br>         U __Znwj<br>00000000 T _whatever<br><br>F:\LLVM-fresh\vs11\bin\Debug><br>

<br><br>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin>link /DLL /NOENTRY te<br>stdll.o /VERBOSE<br>Microsoft (R) Incremental Linker Version 11.00.50727.1<br>Copyright (C) Microsoft Corporation.  All rights reserved.<br>

<br><br>Starting pass 1<br><br>Searching libraries<br><br>Finished searching libraries<br><br>Finished pass 1<br><br>testdll.o : error LNK2019: unresolved external symbol __Znwj referenced in funct<br>ion _whatever<br>testdll.dll : fatal error LNK1120: 1 unresolved externals<br>

<br><br><br></div>How can I get this to link? Thanks.</div>