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 7491953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:12:07+00:00 2026-05-29T16:12:07+00:00

so ive descided to change my class ( a resource manager class ) into

  • 0

so ive descided to change my class ( a resource manager class ) into a static class in c++
and i got an error message which i can not understand… maybe you guys can help me? 🙂

heres the header file:

#ifndef RESOURCEMANAGER_H
#define RESOURCEMANAGER_H

#include <iostream>
#include <map>
#include <string>
#include "Image.h"

namespace sz {
    typedef std::map<std::string, sz::Image> TStrImageMap;
    typedef std::pair<std::string, sz::Image> TStrImagePair;

    class ResourceManager {
    private:
        static TStrImageMap images; // Name, Image(sz::Image)
    public:

        static void AddImage(std::string name, std::string path);
        //void AddSound();

        static sz::Image &GetImage(std::string name);
        //GetSound();
    };
}
#endif

and here is the error that im getting:

1>------ Build started: Project: Basic SFML, Configuration: Debug Win32 ------
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>ResourceManager.obj : error LNK2001: unresolved external symbol "private: static class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class sz::Image,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class sz::Image> > > sz::ResourceManager::images" (?images@ResourceManager@sz@@0V?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VImage@sz@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VImage@sz@@@std@@@2@@std@@A)
1>C:\Users\Gannash\Desktop\Game Project\Debug\Basic SFML.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

please be gentle guys im new to stackoverflow 😀

  • 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-29T16:12:08+00:00Added an answer on May 29, 2026 at 4:12 pm

    You have declared the static member, but not defined it; you need a definition in one (and only one) source file:

    #include "ResourceManager.h"
    
    sz::TStrImageMap sz::ResourceManager::images;
    

    If you’re not sure about the difference between a declaration and a definition, here is a thorough discussion.

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

Sidebar

Related Questions

I have a class which extends Application in an Android tabHost app. In the
I've looked a lot into this, but I can only seem to get webView
i just got into game development and XNA and was following a tutorial and
When I try to do this I receive the following error message: Add member
Ive got a javascript calculating the height of a iframe element and the document
Ive decided that I really dont like microsoft and their ways. Please could you
I've decided to get back into LISP (haven't used it since my AI classes)
I've decided I want to get more into native code development with C++. I'm
I've decided to take the advice in this question: create-excel-chart-programmatically-in-php and NOT attempt to
I've been playing around trying to thoroughly understand Reference and Value types. Just when

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.