Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1036277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:40:38+00:00 2026-05-16T14:40:38+00:00

I am trying to implement hash_multimap in C++. Here is the code: #include <hash_map>

  • 0

I am trying to implement hash_multimap in C++. Here is the code:

#include <hash_map>
#include<iostream>
#include <string>
#include <hashtable.h>
#include <hash_set>

#include <stdlib.h>
#include <stdio.h>
struct eqstr{
    bool operator()(const char *s1,const char* s2)const{
        return strcmp(s1,s2)==0;
    }
};

typedef hash_multimap<const char*, int, hash<const char*>, eqstr> map_type;

int main() {
    return (EXIT_SUCCESS);
}

But here is the mistake:

usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/david/NetBeansProjects/hash_multimap'
/usr/bin/make  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/hash_multimap
make[2]: Entering directory `/home/david/NetBeansProjects/hash_multimap'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
g++    -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
                 from main.cpp:1:
In file included from /usr/include/c++/4.4/backward/hash_map:60,
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
main.cpp: In member function ‘bool eqstr::operator()(const char*, const char*) const’:
main.cpp:10: error: ‘strcmp’ was not declared in this scope
main.cpp: At global scope:
main.cpp:15: error: expected initializer before ‘<’ token
make[2]: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
make[2]: Leaving directory `/home/david/NetBeansProjects/hash_multimap'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/david/NetBeansProjects/hash_multimap'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)

How do I fix this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:40:39+00:00Added an answer on May 16, 2026 at 2:40 pm

    The problems seem pretty straightforward.

    • warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.

    Track down the deprecated header, and look for upgraded packages, libraries, etc. Otherwise, hand-edit the code to update the deprecated header.

    • main.cpp: In member function ‘bool eqstr::operator()(const char*, const char*) const’:
      main.cpp:10: error: ‘strcmp’ was not declared in this scope

    Declare it. Probably by including string.h

    • main.cpp:15: error: expected initializer before ‘<’ token

    A bit less clear, but will probably become clearer as you fix earlier problems. Track down exactly which < is creating the error, and begin carefully reviewing the definitions of hash_multimap and hash

    Where exactly are you having problems?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement email confirmation using Pyramid framework. Here's the code that confirms
Trying to implement a search similar to here .This searches properties based on city,locality,property
Afternoon, I'm trying to implement a hashtable in Java, using K mod 13 as
I am trying to implement a simple HashTable in Java that uses a Linked
I am new to boost. I am trying to implement boost::unorder_set. Here is the
I'm trying to implement a remember me feature, following the guidelines provided here: The
I'm trying to implement a function which returns a string of hex values. I
I'm trying to write a string to a socket (socket is called response). Here
I'm trying implement A* Start path finding in my games(which are written with JavaScript,
I am trying implement a most recent widget into my tumblr post. So far,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.