This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Using std::basic_string<int> results in link error
- From: Jean-Francois Im <jeanfrancois dot im at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 19 Oct 2004 15:41:16 -0400
- Subject: Using std::basic_string<int> results in link error
- Domainkey-signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=OHoWm7P9xBIQT6yHU9oS2zwrJVAeVjXEFwHf2ztOvyI8eYCQl+wPxAE+H+1BzoCeaHfFP1Y2twFN0wbS1xAHxYlU5OPkU838ObmZWVoLTST/LUBgWp3MN6Y1KqopH8avwzBrYGkhf9zSzMQndvWLCKo6gEPe3GgWj07zF1wC18E
- Reply-to: Jean-Francois Im <jeanfrancois dot im at gmail dot com>
Hi,
I am porting a program to GNU/Linux which uses the ICU library. Parts
of this code uses the std::basic_string<> template with the UChar32
type from ICU (http://oss.software.ibm.com/icu/apiref/umachine_8h.html#a35).
However, this results in errors at link time.
For example, this simple program does not compile(if it does, change
int to long or float or another non-char and non-wchar_t type) :
#include <string>
int main() {
std::basic_string<int> foo;
foo+=(int)'a';
return 0;
}
The cause of this problem seems to be rooted in the fact that
templates are in libstdc++ instead of being compiled when using the
STL. Is there a parameter that can be passed to g++ to tell it to
compile the STL templates on the fly instead of using the precompiled
ones?