This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51813] New: -fvisibility=hidden causes std::codecvt members to be undefined
- From: "sefi at s-e-f-i dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jan 2012 14:37:32 +0000
- Subject: [Bug c++/51813] New: -fvisibility=hidden causes std::codecvt members to be undefined
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51813
Bug #: 51813
Summary: -fvisibility=hidden causes std::codecvt members to be
undefined
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sefi@s-e-f-i.de
The following program causes undefined symbols when -fvisibility=hidden is
used:
#include <locale>
int main()
{
std::use_facet<std::codecvt<wchar_t, char, std::mbstate_t>
>(std::locale());
}
g++-4.7 -fvisibility=hidden test.cpp
/tmp/cclBRkzy.o: In function `main':
test.cpp:(.text+0x1d): undefined reference to `std::codecvt<wchar_t, char,
__mbstate_t> const& std::use_facet<std::codecvt<wchar_t, char, __mbstate_t>
>(std::locale const&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0-alpha20120107/../../../../x86_64-pc-linux-gnu/bin/ld:
a.out: hidden symbol
`_ZSt9use_facetISt7codecvtIwc11__mbstate_tEERKT_RKSt6locale' isn't defined
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.0-alpha20120107/../../../../x86_64-pc-linux-gnu/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
It works with gcc-4.6.2.
use_facet is only an example. I had other functions like do_length, the
destructor, etc. reported as undefined as well.