<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 --- - Linker error: undefined reference to `std::vector<...>::~vector()"
href="https://llvm.org/bugs/show_bug.cgi?id=30820">30820</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Linker error: undefined reference to `std::vector<...>::~vector()
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>serguei.kolos@cern.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Hi
I have recently encountered the problem of compiling some code which uses
std::vector class. Here is the minimal example which reproduces the problem:
#include <vector>
template <typename I>
void f(I i, const std::vector<int> & v = { 1, 2, 3}) {
}
int main(int , char**) {
f(1);
}
Here is the compiler output:
:> clang++ -std=c++14 t.cc
/tmp/kolos/ttt-460d3b.o: In function `main':
ttt.cc:(.text+0x61): undefined reference to `std::vector<int,
std::allocator<int> >::~vector()'
ttt.cc:(.text+0x92): undefined reference to `std::vector<int,
std::allocator<int> >::~vector()'
clang-3.9: error: linker command failed with exit code 1 (use -v to see
invocation)
Here are the system and compiler details
:> clang++ -v
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /external/llvm/3.9/x86_64-slc6/bin
Found candidate GCC installation:
/contrib/gcc/4.9/x86_64-slc6/lib/gcc/x86_64-unknown-linux-gnu/4.9.3
Selected GCC installation:
/contrib/gcc/4.9/x86_64-slc6/lib/gcc/x86_64-unknown-linux-gnu/4.9.3
Candidate multilib: .;@m64
Selected multilib: .;@m64
:> uname -a
Linux 2.6.32-642.6.1.el6.x86_64 #1 SMP Wed Oct 5 16:49:07 CEST 2016 x86_64
x86_64 x86_64 GNU/Linux</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>