<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - "duplicate symbol" when using "-fprofile-instr-generate" and "using namespace std;" is used in two .cpp files"
href="https://bugs.llvm.org/show_bug.cgi?id=42516">42516</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>"duplicate symbol" when using "-fprofile-instr-generate" and "using namespace std;" is used in two .cpp files
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>8.0
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alorbach@adiscon.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>So I am trying to do coverage with -fprofile-instr-generate and
-fcoverage-mapping on Windows with clang-8 (confirmed that devel clang 9 has
the same problem).
So if have a library porject that have two .cpp files in your project which use
this on top:
using namespace std;
Once the compiled library is linked, you will get this error:
Error duplicate symbol: __profn_??_G_Facet_base@std@@UEAAPEAXI@Z in
project.lib(code1.obj) and in project.lib(code2.obj)
I could nail the problem down the namespace std, if you remove it from one if
the code files it will link.</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>