473,329 Members | 1,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,329 software developers and data experts.

STL & basic_string<XMLCh> link error

Hello,

I have some link problems while using basic_string with another type
(unsigned int in my case)

This is a sample source :

"

#include <string>

using namespace std;

typedef unsigned int XMLCh;

typedef basic_string<XMLCh> xmlstring;

int main()
{
xmlstring str;
str = (XMLCh)'T';
return 0;
}

"

I get many error of this kind :
"
: undefined reference to `std::char_traits<unsigned>::assign(unsigned*,
unsigned, unsigned)'
/tmp/cckF0b4s.o(.gnu.linkonce.t._ZNSbIjSt11char_traitsI jESaIjEE9_M_mutateEjjj+0x147):
In function `std::basic_string<unsigned, std::char_traits<unsigned>,
std::allocator<unsigned> >::_M_mutate(unsigned, unsigned, unsigned)':
: undefined reference to `std::char_traits<unsigned>::copy(unsigned*,
unsigned const*, unsigned)'
/tmp/cckF0b4s.o(.gnu.linkonce.t._ZNSbIjSt11char_traitsI jESaIjEE9_M_mutateEjjj+0x182):
In function `std::basic_string<unsigned, std::char_traits<unsigned>,
std::allocator<unsigned> >::_M_mutate(unsigned, unsigned, unsigned)':
: undefined reference to `std::char_traits<unsigned>::copy(unsigned*,
unsigned const*, unsigned)'
"
I tried with g++ 3.3.2 (Debian) :
"
Lecture des spécification à partir de
/usr/lib/gcc-lib/i486-linux/3.3.2/specs
Configuré avec: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--with-system-zlib --enable-nls --without-included-gettext
--enable-__cxa_atexit --enable-clocale=gnu --enable-debug
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Modèle de thread: posix
version gcc 3.3.2 (Debian)
"

This works fine with another compiler on Windows, but I suspect this is
due to the fact that this compiler defines wchar_t as an unsigned int.

Am I doing something wrong ?

Thanks in advance for any clue

[XPost + Fu2 gnu.gcc.help]

--
Rémi Peyronnet

Jul 22 '05 #1
0 1541

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suzanne | last post by:
Hi++, I get a link error when I try to call a template function that is declared in a header file and defined in a non-header file. I do *not* get this link error if I define the template...
0
by: david | last post by:
Hello! I've a link error problem problem with VS .NET 2003. I give you the complete description of a simple test (to simplify) : First, I make a WIN32 static library supporting MFC and using...
1
by: Peter | last post by:
Hi, I got the following link error in my release build (I am using vc7 on WinXP): ----------------------------------------- Linking... LINK : error LNK2020: unresolved token (0A000020)...
5
by: sriram | last post by:
I have the following: class BSA { ... ... ... ... public: enum VRGAttrId {
2
by: Helen | last post by:
Hi I am trying to compile a package of avi to mpeg1 C source codes But I got the link error I searched actually my VFW.h and Vfw32.lib are all in the directory what should I do thanks a lot...
1
by: Helen | last post by:
Hi I am trying to compile a package of avi to mpeg1 C source codes by Visual C++ 6.0. But I got the link error --------------------Configuration: AviMp1 - Win32 Debug--------------------...
10
by: Gary Hughes | last post by:
I'm getting the following error when attempting to link a managed C++ dll. I can't find any reference to these errors with google. Can anyone help? I've included the class definition causing the...
2
by: Vickie | last post by:
I have a very simple program with some computations. After using NODEFAULTLIB to get rid of LNK2005 errors such as: LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in...
4
by: Jun | last post by:
anyone know how this error shows? how can i solve this? LINK : error LNK2020: unresolved token (0A0000EA) _AtlBaseModule LINK : error LNK2020: unresolved token (0A0000EC) atlTraceGeneral LINK :...
5
by: ivy146 | last post by:
Hi! I got the link error problem (shown as bellow) when I complied my project. Fatal: Expected a file name: Then I searched from google and followed the suggestion to update the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.