Error reading variable. Cannot create a lazy string with address2019 Community Moderator Electioniostream linker errorRead whole ASCII file into C++ std::stringHow to ensure that you are building against STLportC++: accessing private fields and function from mainstd::async call of member functionSTL map<string, string>, assign 0 value to a key causes compile errorWrong constructor called in custom vector classerror LNK2019: unresolved external symbol "public: __thiscall : constructor issueWhy am I getting multiple definition error when header included?Creating string class with static information
Relationship between sampajanna definitions in SN 47.2 and SN 47.35
Bacteria contamination inside a thermos bottle
When to use a slotted vs. solid turner?
What options are left, if Britain cannot decide?
Did Ender ever learn that he killed Stilson and/or Bonzo?
How do I hide Chekhov's Gun?
Why did it take so long to abandon sail after steamships were demonstrated?
Employee lack of ownership
A diagram about partial derivatives of f(x,y)
Does multi-classing into Fighter give you heavy armor proficiency?
Why do tuner card drivers fail to build after kernel update to 4.4.0-143-generic?
How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?
Why is a white electrical wire connected to 2 black wires?
Why do newer 737s use two different styles of split winglets?
The German vowel “a” changes to the English “i”
Non-trivial topology where only open sets are closed
What are substitutions for coconut in curry?
Fastest way to pop N items from a large dict
Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?
Do I need life insurance if I can cover my own funeral costs?
Violin - Can double stops be played when the strings are not next to each other?
Brexit - No Deal Rejection
Different outputs for `w`, `who`, `whoami` and `id`
Examples of transfinite towers
Error reading variable. Cannot create a lazy string with address
2019 Community Moderator Electioniostream linker errorRead whole ASCII file into C++ std::stringHow to ensure that you are building against STLportC++: accessing private fields and function from mainstd::async call of member functionSTL map<string, string>, assign 0 value to a key causes compile errorWrong constructor called in custom vector classerror LNK2019: unresolved external symbol "public: __thiscall : constructor issueWhy am I getting multiple definition error when header included?Creating string class with static information
I have following code:
#include <string>
#include <vector>
class A
public:
std::string s = "test";
;
class B
public:
std::vector<A> vec;
;
int main()
std::vector<B> vec;
A a1 = A();
A a2 = A();
B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);
vec.push_back(b1); // push_1
vec.push_back(b1);
Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:
__lhs s = "test"
__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.
The application exit code is 0.
But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?
c++
|
show 1 more comment
I have following code:
#include <string>
#include <vector>
class A
public:
std::string s = "test";
;
class B
public:
std::vector<A> vec;
;
int main()
std::vector<B> vec;
A a1 = A();
A a2 = A();
B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);
vec.push_back(b1); // push_1
vec.push_back(b1);
Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:
__lhs s = "test"
__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.
The application exit code is 0.
But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?
c++
1
I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing#include <vector>
and#include <string>
.
– Werner Henze
Mar 6 at 21:10
You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.
– bielu000
Mar 6 at 21:17
Are you debugging an optimized build?
– alter igel
Mar 6 at 21:31
@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...
– aep
Mar 6 at 22:03
I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.
– bielu000
Mar 7 at 4:51
|
show 1 more comment
I have following code:
#include <string>
#include <vector>
class A
public:
std::string s = "test";
;
class B
public:
std::vector<A> vec;
;
int main()
std::vector<B> vec;
A a1 = A();
A a2 = A();
B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);
vec.push_back(b1); // push_1
vec.push_back(b1);
Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:
__lhs s = "test"
__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.
The application exit code is 0.
But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?
c++
I have following code:
#include <string>
#include <vector>
class A
public:
std::string s = "test";
;
class B
public:
std::vector<A> vec;
;
int main()
std::vector<B> vec;
A a1 = A();
A a2 = A();
B b1 = B();
b1.vec.push_back(a1);
b1.vec.push_back(a2);
vec.push_back(b1); // push_1
vec.push_back(b1);
Whenever I execute this app under debugger, and execution procecss reachs instruction with comment push_1, the execution process is stopped, and I have two followings informations in my debugger output:
__lhs s = "test"
__rhs s = "error reading variable: Cannot create a lazy string with address 0x0, and a non zero length.
The application exit code is 0.
But when I remove property s of class A, or repleace with for instance int property, this strange behaviour does not occure. Why it is happening? Why the string occurrance in the class A, causes this error?
c++
c++
edited Mar 6 at 21:19
bielu000
asked Mar 6 at 20:58
bielu000bielu000
357318
357318
1
I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing#include <vector>
and#include <string>
.
– Werner Henze
Mar 6 at 21:10
You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.
– bielu000
Mar 6 at 21:17
Are you debugging an optimized build?
– alter igel
Mar 6 at 21:31
@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...
– aep
Mar 6 at 22:03
I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.
– bielu000
Mar 7 at 4:51
|
show 1 more comment
1
I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing#include <vector>
and#include <string>
.
– Werner Henze
Mar 6 at 21:10
You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.
– bielu000
Mar 6 at 21:17
Are you debugging an optimized build?
– alter igel
Mar 6 at 21:31
@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...
– aep
Mar 6 at 22:03
I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.
– bielu000
Mar 7 at 4:51
1
1
I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing
#include <vector>
and #include <string>
.– Werner Henze
Mar 6 at 21:10
I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing
#include <vector>
and #include <string>
.– Werner Henze
Mar 6 at 21:10
You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.
– bielu000
Mar 6 at 21:17
You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.
– bielu000
Mar 6 at 21:17
Are you debugging an optimized build?
– alter igel
Mar 6 at 21:31
Are you debugging an optimized build?
– alter igel
Mar 6 at 21:31
@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...
– aep
Mar 6 at 22:03
@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...
– aep
Mar 6 at 22:03
I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.
– bielu000
Mar 7 at 4:51
I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.
– bielu000
Mar 7 at 4:51
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032025%2ferror-reading-variable-cannot-create-a-lazy-string-with-address%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032025%2ferror-reading-variable-cannot-create-a-lazy-string-with-address%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I can't reproduce. What is your platform/compiler? BTW, for a Minimal, Complete, and Verifiable example you are missing
#include <vector>
and#include <string>
.– Werner Henze
Mar 6 at 21:10
You're right I missed the headers. The platform is Linux Debian x64, and to compile I'm using g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516. The C++ standard version is 14.
– bielu000
Mar 6 at 21:17
Are you debugging an optimized build?
– alter igel
Mar 6 at 21:31
@bielu000 I too reckon that this is some kind of an optimized build. Tried this and couldn't reproduce. onlinegdb.com/S18rQTaUE. It's not the same architecture though...
– aep
Mar 6 at 22:03
I think that you're rightit could be because optimized builds, but I don't have any optimiziation flags set. It is really confusing me - I copied all files and directories of above app into another, new directory, and it works correctly... But the original source still works as I said above. I compared all files, from CmakeLists even to IDE configuration settings, but there are any differents.
– bielu000
Mar 7 at 4:51