std::experimental::filesystem::v1::status link error even after -lstdc++ flag
I try c++1z feature to use std::experimental::filesystem
After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.
i.e I am not getting this error anymore
sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'
However, even after linking, I get the following error.
g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
lib/libOpenTimer.a(spef.cpp.o): In functionspef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
lib/libOpenTimer.a(sdc.cpp.o): In functionot::sdc::home[abi:cxx11]()':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x414): undefined reference to
sdc.cpp:(.text+0x7ab): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
lib/libOpenTimer.a(sdc.cpp.o): In function
sdc.cpp:(.text+0x2fa1): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x3084): undefined reference to
sdc.cpp:(.text+0x30db): undefined reference tostd::experimental::filesystem::v1::current_path[abi:cxx11]()'
std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x30f7): undefined reference to
sdc.cpp:(.text+0x3788): undefined reference tostd::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::user_homeabi:cxx11':
lib/libOpenTimer.a(os.cpp.o): In function
os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
collect2: error: ld returned 1 exit status
Any help to resolve this would be much appreciated.
g++ c++17
add a comment |
I try c++1z feature to use std::experimental::filesystem
After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.
i.e I am not getting this error anymore
sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'
However, even after linking, I get the following error.
g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
lib/libOpenTimer.a(spef.cpp.o): In functionspef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
lib/libOpenTimer.a(sdc.cpp.o): In functionot::sdc::home[abi:cxx11]()':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x414): undefined reference to
sdc.cpp:(.text+0x7ab): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
lib/libOpenTimer.a(sdc.cpp.o): In function
sdc.cpp:(.text+0x2fa1): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x3084): undefined reference to
sdc.cpp:(.text+0x30db): undefined reference tostd::experimental::filesystem::v1::current_path[abi:cxx11]()'
std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x30f7): undefined reference to
sdc.cpp:(.text+0x3788): undefined reference tostd::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::user_homeabi:cxx11':
lib/libOpenTimer.a(os.cpp.o): In function
os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
collect2: error: ld returned 1 exit status
Any help to resolve this would be much appreciated.
g++ c++17
add a comment |
I try c++1z feature to use std::experimental::filesystem
After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.
i.e I am not getting this error anymore
sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'
However, even after linking, I get the following error.
g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
lib/libOpenTimer.a(spef.cpp.o): In functionspef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
lib/libOpenTimer.a(sdc.cpp.o): In functionot::sdc::home[abi:cxx11]()':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x414): undefined reference to
sdc.cpp:(.text+0x7ab): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
lib/libOpenTimer.a(sdc.cpp.o): In function
sdc.cpp:(.text+0x2fa1): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x3084): undefined reference to
sdc.cpp:(.text+0x30db): undefined reference tostd::experimental::filesystem::v1::current_path[abi:cxx11]()'
std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x30f7): undefined reference to
sdc.cpp:(.text+0x3788): undefined reference tostd::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::user_homeabi:cxx11':
lib/libOpenTimer.a(os.cpp.o): In function
os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
collect2: error: ld returned 1 exit status
Any help to resolve this would be much appreciated.
g++ c++17
I try c++1z feature to use std::experimental::filesystem
After adding -lstdc++fs flag with g++, I can see that I am able to link std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts() with my program.
i.e I am not getting this error anymore
sdc.cpp:(.text+0x7e5): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'
However, even after linking, I get the following error.
g++ -std=c++1z timer.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
lib/libOpenTimer.a(spef.cpp.o): In functionspef::Spef::read(std::experimental::filesystem::v1::__cxx11::path const&)':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
spef.cpp:(.text._ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE[_ZN4spef4Spef4readERKNSt12experimental10filesystem2v17__cxx114pathE]+0x2e): undefined reference to
lib/libOpenTimer.a(sdc.cpp.o): In functionot::sdc::home[abi:cxx11]()':
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x414): undefined reference to
sdc.cpp:(.text+0x7ab): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::sdc::SDC::read(std::experimental::filesystem::v1::__cxx11::path const&)':
lib/libOpenTimer.a(sdc.cpp.o): In function
sdc.cpp:(.text+0x2fa1): undefined reference tostd::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x3084): undefined reference to
sdc.cpp:(.text+0x30db): undefined reference tostd::experimental::filesystem::v1::current_path[abi:cxx11]()'
std::experimental::filesystem::v1::absolute(std::experimental::filesystem::v1::__cxx11::path const&, std::experimental::filesystem::v1::__cxx11::path const&)'
sdc.cpp:(.text+0x30f7): undefined reference to
sdc.cpp:(.text+0x3788): undefined reference tostd::experimental::filesystem::v1::remove(std::experimental::filesystem::v1::__cxx11::path const&)'
ot::user_homeabi:cxx11':
lib/libOpenTimer.a(os.cpp.o): In function
os.cpp:(.text+0x30d): undefined reference to `std::experimental::filesystem::v1::current_pathabi:cxx11'
collect2: error: ld returned 1 exit status
Any help to resolve this would be much appreciated.
g++ c++17
g++ c++17
asked Nov 24 '18 at 15:09
BragadeeshBragadeesh
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It was me who posted the question. It seems like I was able to resolve it myself.
I added the -lstdc++fs at the end instead of middle and it started working.
Here's the updated command
g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs
compared to the previous command
g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
Don't know why some linking flags are expected to be added in the end though.
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%2f53459491%2fstdexperimentalfilesystemv1status-link-error-even-after-lstdc-flag%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
It was me who posted the question. It seems like I was able to resolve it myself.
I added the -lstdc++fs at the end instead of middle and it started working.
Here's the updated command
g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs
compared to the previous command
g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
Don't know why some linking flags are expected to be added in the end though.
add a comment |
It was me who posted the question. It seems like I was able to resolve it myself.
I added the -lstdc++fs at the end instead of middle and it started working.
Here's the updated command
g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs
compared to the previous command
g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
Don't know why some linking flags are expected to be added in the end though.
add a comment |
It was me who posted the question. It seems like I was able to resolve it myself.
I added the -lstdc++fs at the end instead of middle and it started working.
Here's the updated command
g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs
compared to the previous command
g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
Don't know why some linking flags are expected to be added in the end though.
It was me who posted the question. It seems like I was able to resolve it myself.
I added the -lstdc++fs at the end instead of middle and it started working.
Here's the updated command
g++ -std=c++1z timerapp.cpp -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out -lstdc++fs
compared to the previous command
g++ -std=c++1z timerapp.cpp -lstdc++fs -O2 -I include -L lib -lOpenTimer -lpthread -o timer.out
Don't know why some linking flags are expected to be added in the end though.
answered Nov 24 '18 at 15:39
BragadeeshBragadeesh
11
11
add a comment |
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%2f53459491%2fstdexperimentalfilesystemv1status-link-error-even-after-lstdc-flag%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