Hi,

I have to create a map table in C.
I have used the following codes :

**************************************
#include <map.h>
using namespace std;

map <char,char> fileMap;
fileMap.clear();
CL_LOG_INFO(" Putting into HASH MAP");
// Storing into the map
fileMap.insert(make_pair(key_xsd,key_moc));
CL_LOG_DEBUG("hash table");
CL_LOG_DEBUG(fileMap);
*************************************
I am getting following compilation errors :

snmpd.c:379:17: error: map.h: No such file or directory
snmpd.c:381: error: syntax error before 'namespace'
snmpd.c:381: warning: data definition has no type or storage class
snmpd.c: In function 'mapfile_initialize':
snmpd.c:1044: error: 'map' undeclared (first use in this function)
snmpd.c:1044: error: (Each undeclared identifier is reported only once
snmpd.c:1044: error: for each function it appears in.)
snmpd.c:1044: error: syntax error before 'char'
snmpd.c:1070: warning: passing argument 1 of 'strcmp' makes pointer from integer without a cast
snmpd.c:1094: error: 'fileMap' undeclared (first use in this function)

What can I do.. Is there any other way this can be done?I am running a c++ compiler so I was expecting it to work.It is not recognising map.h or map in that case.I am new to c++ programming so need some help.

Nisha

>snmpd.c:379:17: error: map.h: No such file or directory
If you want to use the std::map class, it's in <map>, not <map.h>. All of the modern standard C++ libraries omit the .h extension.

>snmpd.c:381: error: syntax error before 'namespace'
What brand and version is your compiler?

Hi Narue,

1.I tried with map instead of map.h but I am seeing the similar error
2.I am using a gcc compiler version 3.3.6

Nisha

This article has been dead for over six months. Start a new discussion instead.