Sep 29, 2009 at 3:20am UTC
Hi,
The following code works if I cross-compile it for one of my board using mips-linux-uclibc-g++ but crashes if I cross-compile it for another board using arm_v5t_le-g++. Any idea what's the problem?
//Webserver.h
class Webserver :public AbstractImMsgClient
{
.
.
.
private:
static std::map<std::string, std::string*> m_parameters;
};
//Webserver.cpp
std::map<std::string, std::string*> m_parameters;
static std::string NetworkingMode("0");
Webserver::Webserver()
{
.
.
.
//segmentation fault here
m_parameters["NetworkingMode"] = &NetworkingMode;
.
.
.
}
Regards,
Kwan.
Sep 29, 2009 at 4:45am UTC
I am not shure, but you can try to use the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
static std::string NetworkingMode("0" ); // I've changed order
std::map<std::string, std::string*> m_parameters;
Webserver::Webserver()
{
.
.
.
//segmentation fault here
m_parameters.insert(std::pair<std::string, std::string*>("NetworkingMode" , &NetworkingMode));
.
.
.
}
Last edited on Sep 29, 2009 at 4:46am UTC