473,804 Members | 3,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

STL & basic_string<XM LCh> 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<XM LCh> xmlstring;

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

"

I get many error of this kind :
"
: undefined reference to `std::char_trai ts<unsigned>::a ssign(unsigned* ,
unsigned, unsigned)'
/tmp/cckF0b4s.o(.gnu .linkonce.t._ZN SbIjSt11char_tr aitsIjESaIjEE9_ M_mutateEjjj+0x 147):
In function `std::basic_str ing<unsigned, std::char_trait s<unsigned>,
std::allocator< unsigned> >::_M_mutate(un signed, unsigned, unsigned)':
: undefined reference to `std::char_trai ts<unsigned>::c opy(unsigned*,
unsigned const*, unsigned)'
/tmp/cckF0b4s.o(.gnu .linkonce.t._ZN SbIjSt11char_tr aitsIjESaIjEE9_ M_mutateEjjj+0x 182):
In function `std::basic_str ing<unsigned, std::char_trait s<unsigned>,
std::allocator< unsigned> >::_M_mutate(un signed, unsigned, unsigned)':
: undefined reference to `std::char_trai ts<unsigned>::c opy(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,pasca l,objc,ada,tree lang --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 1570

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

Similar topics

6
11540
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 function directly in the header file, or if the change the function to non-template. For example... *** Why am I getting a link error for template function f() in the code below?
0
1023
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 precompiled header. It contains : ***** testlib.h:
1
2214
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) _CrtDbgReport LINK : fatal error LNK1120: 1 unresolved externals -----------------------------------------
5
2130
by: sriram | last post by:
I have the following: class BSA { ... ... ... ... public: enum VRGAttrId {
2
6921
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 Linking... Avi2mpg1.obj : error LNK2001: unresolved external symbol _AVIFileExit@0 Avi2mpg1.obj : error LNK2001: unresolved external symbol _AVIFileRelease@4 Avi2mpg1.obj : error LNK2001: unresolved external symbol _AVIStreamGetFrameC lose@4
1
1899
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-------------------- Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/AviMp1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
10
9530
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 errors below. Everything compiles fine and all the types are defined, it appears that the template type itga::order_collection::iterator is causing the trouble. Gary.
2
1705
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 msvcrtd.lib(MSVCR71D.dll) Now I have two new LNK2020 errors: LINK : error LNK2020: unresolved token (0A000021) std._Lockit.__dtor LINK : error LNK2020: unresolved token (0A000022) _DebugHeapTag LINK : fatal error LNK1120: 2 unresolved externals
4
6108
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 : error LNK2020: unresolved token (0A0000ED) ?s_trace@CTrace@ATL@@2V12@A LINK : fatal error LNK1120: 3 unresolved externals thanks in advance.
5
10212
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 ilinker32.exe and ilinker32.dll. The link problem was still there but in the different type: Fatal: Access violation. Link terminated.
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.