<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang++ linker errors: Undefined reference to 'typeinfo for class '(MinGW target)"
href="https://llvm.org/bugs/show_bug.cgi?id=27966">27966</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang++ linker errors: Undefined reference to 'typeinfo for class '(MinGW target)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hua.andy@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=16449" name="attach_16449" title="testcase">attachment 16449</a> <a href="attachment.cgi?id=16449&action=edit" title="testcase">[details]</a></span>
testcase
D:\home>clang++ --target=x86_64-pc-windows-gnu -v
clang version 3.8.0 (branches/release_38)
Target: x86_64-pc-windows-gnu
Thread model: posix
InstalledDir: D:\mingw64\clang\bin
===============compile the tests======================
D:\home\tests>clang++ -o liba.dll -shared -fPIC -Wl,--out-implib=liba.dll.a
b.cpp -DBUILDING_DLL --target=x86_64-pc-windows-gnu
D:\home\tests>clang++ -o c.exe c.cpp -L. -la
C:\Users\xxxx\AppData\Local\Temp\c-bc7c5f.o:(.rdata[_ZTI1B]+0x10): undefined
reference to `typeinfo for A'
clang++.exe: error: linker command failed with exit code 1 (use -v to see
invocation)
but i use the following command to compile the program:
clang++ -o liba.dll -shared -fPIC -Wl,--out-implib=liba.dll.a b.cpp
-DBUILDING_DLL --target=x86_64-pc-windows-gnu
g++ -o c.exe c.cpp -L. -la
Is ok.
g++ -o liba.dll -shared -fPIC -Wl,--out-implib=liba.dll.a b.cpp -DBUILDING_DLL
clang++ -o c.exe c.cpp -L. -la
Is ok.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>