473,467 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

STL undefined symbols strikes again!

1 New Member
not typecast data with const

Try this code. this will solve your problem

#include <iostream>
#include <map>
using namespace std;

int main ()
{
multimap<char,int> mymultimap;
multimap<char,int>::const_iterator it;
char c1 = 'a';
char c2 = 'b';
char c3 = 'c';

mymultimap.insert (std::make_pair<const char, int> ((const)c1,100) );
mymultimap.insert (std::Make_pair<const char, int> ((const)c2,150) );
mymultimap.insert (std::make_pair<const char, int> ((const)c3,75) );

cout << "mymultimap contains:\n";
for ( it=mymultimap.begin() ; it != mymultimap.end(); it++ )
cout << (*it).first << " => " << (*it).second << endl;

return 0;
}
Mar 13 '07 #1
1 1011
bartonc
6,596 Recognized Expert Expert
not typecast data with const

Try this code. this will solve your problem
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7.   multimap<char,int> mymultimap;
  8.   multimap<char,int>::const_iterator it;
  9.    char c1 = 'a';
  10.    char c2 = 'b';
  11.    char c3 = 'c';
  12.  
  13.   mymultimap.insert (std::make_pair<const char, int> ((const)c1,100) );
  14.   mymultimap.insert (std::Make_pair<const char, int> ((const)c2,150) );    
  15.   mymultimap.insert (std::make_pair<const char, int> ((const)c3,75) );
  16.  
  17.   cout << "mymultimap contains:\n";
  18.   for ( it=mymultimap.begin() ; it != mymultimap.end(); it++ )
  19.     cout << (*it).first << " => " << (*it).second << endl;
  20.  
  21.   return 0;
  22. }
If that's Java, you'll have better luck getting help in the Java Forum. If not, you'll find all the links to software development help on the right hand side of this page. Welcome to TheScripts.
Mar 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of...
1
by: Stu | last post by:
I am trying to build the xerces shared library with 2.3.0 version of their source code on an AIX 5.1 32 bit machine with the following version of the g++ compiler /usr/local/bin/g++ -v Reading...
9
by: PengYu.UT | last post by:
std::size_t and std::ptrdiff_t are defined in <cstddef>. I've noticed that a bunch of old math function in the global namespace are undefined in <cmath> and they are redefined in std namespace. ...
0
by: Alexander Cohen | last post by:
IM trying to build the ppostgres ODBC driver for MacOSX. I thought id try and build it as a bundle from XCode. All compiles no problem but then at the end of the compile i get an undefined symbols...
3
by: comp.lang.php | last post by:
I have a counter that evokes the "Three Strikes You're Out" rule.. if you make more than N mistakes it auto-resets to avoid flooding $_SESSION with attempt after attempt, etc. However, the...
1
by: yamitmehta | last post by:
When I compile to code using g++arm of VxWorks 5.5 and put it on my board i get the follwing undefined symbols:- Cpool and Csingleton are template classes. CPool has the static member...
1
by: Justin Johnson | last post by:
Hello, I'm trying to build Python 2.5.0 on AIX 5.3 using IBM's compiler (VisualAge C++ Professional / C for AIX Compiler, Version 6). I run configure and make, but makes fails with undefined...
6
by: Vijay Bajwa | last post by:
Once again, the FORTE 7.0 compiler on Sun screwed me. The error msgs are incomprehensible. There is the familiar STL linkage problem, libraries compile fine tho. it's only when I compile the main...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
2
by: nd.sundar | last post by:
Hi, I have a collection of C source files (.c and .h). I need to find all identifiers which are used in that collection but not defined within the collection. The identifiers include pre-processor...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
1
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...
0
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...
0
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.