I'm new to boost::variant and I can't seem to use it in a class
because I get linker errors. I can't find any reference to this in the
archive or the docs so I figure it must be something silly I'm
missing. Any help appreciated. The compilation command, error, and
files are shown below.
Thanks,
Kevin Martin
g++ -I $BOOSTINC test.cpp a.cpp
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-
linux/bin/ld:
`
.gnu
.linkonce
.t
._ZN5boost6detail7variant15visitation_implIN4mpl_4int_ILi0EEENS1_20visitation_impl_stepINS_3mpl6l_iterINS7_6l_itemINS3_5long_ILl2EEEiNS9_INSA_ILl1EEESsNS7_5l_endEEEEEEENS8_ISD_EEEENS1_9destroyerEPvNS_7variantIiSsNS1_5void_ESM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_E18has_fallback_type_EEEN7Visitor11result_typeEiiRSP_T2_NS3_5bool_ILb0EEET3_PT_PT0_
' referenced in section `.rodata' of /tmp/ccZwRSZE.o: defined in
discarded section
`
.gnu
.linkonce
.t
._ZN5boost6detail7variant15visitation_implIN4mpl_4int_ILi0EEENS1_20visitation_impl_stepINS_3mpl6l_iterINS7_6l_itemINS3_5long_ILl2EEEiNS9_INSA_ILl1EEESsNS7_5l_endEEEEEEENS8_ISD_EEEENS1_9destroyerEPvNS_7variantIiSsNS1_5void_ESM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_SM_E18has_fallback_type_EEEN7Visitor11result_typeEiiRSP_T2_NS3_5bool_ILb0EEET3_PT_PT0_
' of /tmp/ccZwRSZE.o
The files are:
==== a.h ====
#ifndef __A_HEADER__
#define __A_HEADER__
#include
AMDG Kevin Martin wrote:
I'm new to boost::variant and I can't seem to use it in a class because I get linker errors. I can't find any reference to this in the archive or the docs so I figure it must be something silly I'm missing. Any help appreciated. The compilation command, error, and files are shown below.
Your code compiles and links for me with gcc 3.4.4 on cygwin and with visual studio 2008. In Christ, Steven Watanabe
On 2 Aug 2008, at 20:44, Steven Watanabe wrote:
Your code compiles and links for me with gcc 3.4.4 on cygwin and with visual studio 2008.
Thanks for that, I've just tried it with the intel compiler and it works - I guess that explains why I couldn't find any reference to the error in the archive. I'll tell my tech guys. Just in case anyone else encounters something similar my g++ --version returns g++ (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Thanks, Kevin Martin
I works fine for me too. Which compiler and version are you using ? -- Alp Mestan --- http://blog.mestan.fr/ --- http://alp.developpez.com/ --- In charge of the Qt, Algorithms and Artificial Intelligence sections on Developpez
participants (3)
-
Alp Mestan
-
Kevin Martin
-
Steven Watanabe