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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:27:25+00:00 2026-05-26T04:27:25+00:00

I have the following class: #ifndef CGE_NET_MESSAGE_PARSER_HPP #define CGE_NET_MESSAGE_PARSER_HPP #include Game/platform.hpp #include <vector> #include

  • 0

I have the following class:

#ifndef CGE_NET_MESSAGE_PARSER_HPP
#define CGE_NET_MESSAGE_PARSER_HPP
#include "Game/platform.hpp"
#include <vector>
#include <string>
#include <sstream>

namespace cge
{
    class NetMessageParser
    {
        static std::stringstream ss;
        static void clearStream();
    public:
        NetMessageParser(void);
        static int parseInt(const std::string &str);
        static float parseFloat(const std::string &str);
        static double parseDouble(const std::string &str);
        static std::vector<int> parseIntVectorString(
            std::string str, char startKey, char endKey, char separator);
        static std::string numberToString(int n);
        static std::string numberToString(float n);
        static std::string numberToString(double n);
        virtual ~NetMessageParser(void);
    };

}
#endif

Which produces the following linker error:

Error 3 error LNK2001: unresolved external symbol “private: static
class std::basic_stringstream,class
std::allocator > cge::NetMessageParser::ss”
(?ss@NetMessageParser@cge@@0V?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) NetMessageParser.obj

What could be wrong?

  • 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-26T04:27:26+00:00Added an answer on May 26, 2026 at 4:27 am

    You have to declare storage for static variables in the CPP file. You probably want something like this

    std::stringstream NetMessageParser::ss;

    Oh and do not put this in header file otherwise you will get errors about multiple definitions

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

Sidebar

Related Questions

I have the following class #ifndef Container_H #define Container_H #include <iostream> using namespace std;
I have the following header file: #ifndef DATABASE_H #define DATABASE_H #include <vector> #include <iostream>
I have this main function: #ifndef MAIN_CPP #define MAIN_CPP #include dsets.h using namespace std;
I have the following class: #include <string> #include <stack> #include <queue> #include map.h using
When I run the following code... #ifndef KEYEDITEM_H_INCLUDED #define KEYEDITEM_H_INCLUDED #include <string> typedef std::string
I have the following code: Master.h #ifndef MASTER_H #define MASTER_H class Master { friend
I have the following pieces of code: Leomedia.h #include MusicMetaDatter.h #ifndef LEOMEDIA_H #define LEOMEDIA_H
I have the following header file: #ifndef CLASSES_H #define CLASSES_H class Mouse // Handles
I have the following class: public abstract class AbstractParent { static String method() {
I have the following 4 files: arrayListType.h : Declare and define arrayListType class as

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.