nm symbol both “U” and “T”, what does that mean?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result:
nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U YAML::detail::node_data::empty_scalar[abi:cxx11]
00000000002b5860 T YAML::detail::node_data::empty_scalar[abi:cxx11]()
But how is that possible? The symbol is both undefined, and also in the library? What? Or are these actually different symbols? When mangled the names are indeed slightly different:
nm -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U _ZN4YAML6detail9node_data12empty_scalarB5cxx11E
00000000002b5860 T _ZN4YAML6detail9node_data12empty_scalarB5cxx11Ev
Does this make sense?
c++ undefined-symbol nm
add a comment |
I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result:
nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U YAML::detail::node_data::empty_scalar[abi:cxx11]
00000000002b5860 T YAML::detail::node_data::empty_scalar[abi:cxx11]()
But how is that possible? The symbol is both undefined, and also in the library? What? Or are these actually different symbols? When mangled the names are indeed slightly different:
nm -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U _ZN4YAML6detail9node_data12empty_scalarB5cxx11E
00000000002b5860 T _ZN4YAML6detail9node_data12empty_scalarB5cxx11Ev
Does this make sense?
c++ undefined-symbol nm
Note that the demangled names are also slightly different.
– user10605163
Nov 16 '18 at 21:40
Right, I mentioned that. So they are different? That still seems strange though, how is that allowed? Isn't it a compiler error for a name to be used for both a class function and variable (if that's what these are)?
– Ben Farmer
Nov 16 '18 at 21:42
Ahh ok, indeed they probably couldn't both exist at once, but it seems there are two versions of the external library, one used during the compile, and the other used at link time. This symbol changed from a variable to a function between the two versions. So at compile time the build knows it wants a function, but during linking the variable version gets built into my library.
– Ben Farmer
Nov 16 '18 at 22:07
add a comment |
I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result:
nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U YAML::detail::node_data::empty_scalar[abi:cxx11]
00000000002b5860 T YAML::detail::node_data::empty_scalar[abi:cxx11]()
But how is that possible? The symbol is both undefined, and also in the library? What? Or are these actually different symbols? When mangled the names are indeed slightly different:
nm -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U _ZN4YAML6detail9node_data12empty_scalarB5cxx11E
00000000002b5860 T _ZN4YAML6detail9node_data12empty_scalarB5cxx11Ev
Does this make sense?
c++ undefined-symbol nm
I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result:
nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U YAML::detail::node_data::empty_scalar[abi:cxx11]
00000000002b5860 T YAML::detail::node_data::empty_scalar[abi:cxx11]()
But how is that possible? The symbol is both undefined, and also in the library? What? Or are these actually different symbols? When mangled the names are indeed slightly different:
nm -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_
U _ZN4YAML6detail9node_data12empty_scalarB5cxx11E
00000000002b5860 T _ZN4YAML6detail9node_data12empty_scalarB5cxx11Ev
Does this make sense?
c++ undefined-symbol nm
c++ undefined-symbol nm
asked Nov 16 '18 at 21:38
Ben FarmerBen Farmer
883517
883517
Note that the demangled names are also slightly different.
– user10605163
Nov 16 '18 at 21:40
Right, I mentioned that. So they are different? That still seems strange though, how is that allowed? Isn't it a compiler error for a name to be used for both a class function and variable (if that's what these are)?
– Ben Farmer
Nov 16 '18 at 21:42
Ahh ok, indeed they probably couldn't both exist at once, but it seems there are two versions of the external library, one used during the compile, and the other used at link time. This symbol changed from a variable to a function between the two versions. So at compile time the build knows it wants a function, but during linking the variable version gets built into my library.
– Ben Farmer
Nov 16 '18 at 22:07
add a comment |
Note that the demangled names are also slightly different.
– user10605163
Nov 16 '18 at 21:40
Right, I mentioned that. So they are different? That still seems strange though, how is that allowed? Isn't it a compiler error for a name to be used for both a class function and variable (if that's what these are)?
– Ben Farmer
Nov 16 '18 at 21:42
Ahh ok, indeed they probably couldn't both exist at once, but it seems there are two versions of the external library, one used during the compile, and the other used at link time. This symbol changed from a variable to a function between the two versions. So at compile time the build knows it wants a function, but during linking the variable version gets built into my library.
– Ben Farmer
Nov 16 '18 at 22:07
Note that the demangled names are also slightly different.
– user10605163
Nov 16 '18 at 21:40
Note that the demangled names are also slightly different.
– user10605163
Nov 16 '18 at 21:40
Right, I mentioned that. So they are different? That still seems strange though, how is that allowed? Isn't it a compiler error for a name to be used for both a class function and variable (if that's what these are)?
– Ben Farmer
Nov 16 '18 at 21:42
Right, I mentioned that. So they are different? That still seems strange though, how is that allowed? Isn't it a compiler error for a name to be used for both a class function and variable (if that's what these are)?
– Ben Farmer
Nov 16 '18 at 21:42
Ahh ok, indeed they probably couldn't both exist at once, but it seems there are two versions of the external library, one used during the compile, and the other used at link time. This symbol changed from a variable to a function between the two versions. So at compile time the build knows it wants a function, but during linking the variable version gets built into my library.
– Ben Farmer
Nov 16 '18 at 22:07
Ahh ok, indeed they probably couldn't both exist at once, but it seems there are two versions of the external library, one used during the compile, and the other used at link time. This symbol changed from a variable to a function between the two versions. So at compile time the build knows it wants a function, but during linking the variable version gets built into my library.
– Ben Farmer
Nov 16 '18 at 22:07
add a comment |
1 Answer
1
active
oldest
votes
There are two variants of yaml-cpp:
https://github.com/jbeder/yaml-cpp
https://github.com/jbeder/yaml-cpp.new-api
In the first one the symbol in question is declared as member static const std::string& empty_scalar();.
In the second one it is declared as member static std::string empty_scalar;.
The two symbol names you see match to these two different declarations. This should not be allowed by the compiler if it sees empty_scalar declared inconsistently like this.
I think you linked object files which were compiled with different versions of the header file which declared the symbol. The linker would then consider the two symbols different because of their different names. The object file you used did contain the definition for the old-api variant, but some code is using the new one.
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
add a comment |
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%2f53345773%2fnm-symbol-both-u-and-t-what-does-that-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are two variants of yaml-cpp:
https://github.com/jbeder/yaml-cpp
https://github.com/jbeder/yaml-cpp.new-api
In the first one the symbol in question is declared as member static const std::string& empty_scalar();.
In the second one it is declared as member static std::string empty_scalar;.
The two symbol names you see match to these two different declarations. This should not be allowed by the compiler if it sees empty_scalar declared inconsistently like this.
I think you linked object files which were compiled with different versions of the header file which declared the symbol. The linker would then consider the two symbols different because of their different names. The object file you used did contain the definition for the old-api variant, but some code is using the new one.
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
add a comment |
There are two variants of yaml-cpp:
https://github.com/jbeder/yaml-cpp
https://github.com/jbeder/yaml-cpp.new-api
In the first one the symbol in question is declared as member static const std::string& empty_scalar();.
In the second one it is declared as member static std::string empty_scalar;.
The two symbol names you see match to these two different declarations. This should not be allowed by the compiler if it sees empty_scalar declared inconsistently like this.
I think you linked object files which were compiled with different versions of the header file which declared the symbol. The linker would then consider the two symbols different because of their different names. The object file you used did contain the definition for the old-api variant, but some code is using the new one.
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
add a comment |
There are two variants of yaml-cpp:
https://github.com/jbeder/yaml-cpp
https://github.com/jbeder/yaml-cpp.new-api
In the first one the symbol in question is declared as member static const std::string& empty_scalar();.
In the second one it is declared as member static std::string empty_scalar;.
The two symbol names you see match to these two different declarations. This should not be allowed by the compiler if it sees empty_scalar declared inconsistently like this.
I think you linked object files which were compiled with different versions of the header file which declared the symbol. The linker would then consider the two symbols different because of their different names. The object file you used did contain the definition for the old-api variant, but some code is using the new one.
There are two variants of yaml-cpp:
https://github.com/jbeder/yaml-cpp
https://github.com/jbeder/yaml-cpp.new-api
In the first one the symbol in question is declared as member static const std::string& empty_scalar();.
In the second one it is declared as member static std::string empty_scalar;.
The two symbol names you see match to these two different declarations. This should not be allowed by the compiler if it sees empty_scalar declared inconsistently like this.
I think you linked object files which were compiled with different versions of the header file which declared the symbol. The linker would then consider the two symbols different because of their different names. The object file you used did contain the definition for the old-api variant, but some code is using the new one.
edited Nov 16 '18 at 22:09
answered Nov 16 '18 at 22:08
user10605163user10605163
2,868624
2,868624
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
add a comment |
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
Yeah I think you are right, I just noticed that indeed the wrong version of the library is found by the linker.
– Ben Farmer
Nov 16 '18 at 22:09
add a comment |
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%2f53345773%2fnm-symbol-both-u-and-t-what-does-that-mean%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
Note that the demangled names are also slightly different.
– user10605163
Nov 16 '18 at 21:40
Right, I mentioned that. So they are different? That still seems strange though, how is that allowed? Isn't it a compiler error for a name to be used for both a class function and variable (if that's what these are)?
– Ben Farmer
Nov 16 '18 at 21:42
Ahh ok, indeed they probably couldn't both exist at once, but it seems there are two versions of the external library, one used during the compile, and the other used at link time. This symbol changed from a variable to a function between the two versions. So at compile time the build knows it wants a function, but during linking the variable version gets built into my library.
– Ben Farmer
Nov 16 '18 at 22:07