Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make are not working #19

Open
abdulsec opened this issue Aug 12, 2020 · 7 comments
Open

make are not working #19

abdulsec opened this issue Aug 12, 2020 · 7 comments

Comments

@abdulsec
Copy link

hacker@localhost:~/tools/urldedupe$ make
Scanning dependencies of target urldedupe
[ 20%] Building CXX object CMakeFiles/urldedupe.dir/Url.cpp.o
/home/hacker/tools/urldedupe/Url.cpp:4:10: fatal error: filesystem: No such file or directory
#include
^~~~~~~~~~~~
compilation terminated.
CMakeFiles/urldedupe.dir/build.make:120: recipe for target 'CMakeFiles/urldedupe.dir/Url.cpp.o' failed
make[2]: *** [CMakeFiles/urldedupe.dir/Url.cpp.o] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/urldedupe.dir/all' failed
make[1]: *** [CMakeFiles/urldedupe.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2

@larskraemer
Copy link
Contributor

What OS and compiler are you running? With Versions, ideally.
Seems like you don't have <filesystem> yet. Just to see, try replacing
#include <filesystem>
with
#include <experimental/filesystem>
and see if that works..

@marcelo321
Copy link

Same error here. After changing it to #include <experimental/filesystem> I got the following error:

[ 20%] Building CXX object CMakeFiles/urldedupe.dir/Url.cpp.o
/home/srt_7codgsyhr0/urldedupe/Url.cpp: In member function ‘bool Url::has_extension()’:
/home/srt_7codgsyhr0/urldedupe/Url.cpp:269:10: error: ‘std::filesystem’ has not been declared
     std::filesystem::path fpath {this->path};
          ^~~~~~~~~~
/home/srt_7codgsyhr0/urldedupe/Url.cpp:270:12: error: ‘fpath’ was not declared in this scope
     return fpath.has_extension();
            ^~~~~
/home/srt_7codgsyhr0/urldedupe/Url.cpp:270:12: note: suggested alternative: ‘path’
     return fpath.has_extension();
            ^~~~~
            path
make[2]: *** [CMakeFiles/urldedupe.dir/Url.cpp.o] Error 1
make[1]: *** [CMakeFiles/urldedupe.dir/all] Error 2
make: *** [all] Error 2

I'm on redhat linux

@marcelo321
Copy link

where is the binary..?

@ZultanH
Copy link

ZultanH commented Feb 11, 2021

Not working for me either, same issue

@zeroc00I
Copy link

zeroc00I commented Mar 18, 2021

Same here. I will try do dockerize this tool because its very useful. I will do an update here

Consolidate compiler generated dependencies of target urldedupe
[ 20%] Linking CXX executable urldedupe
/usr/bin/ld: CMakeFiles/urldedupe.dir/Url.cpp.o: in function `std::filesystem::__cxx11::path::has_extension() const':
Url.cpp:(.text._ZNKSt10filesystem7__cxx114path13has_extensionEv[_ZNKSt10filesystem7__cxx114path13has_extensionEv]+0x14): undefined reference to `std::filesystem::__cxx11::path::_M_find_extension() const'
/usr/bin/ld: CMakeFiles/urldedupe.dir/Url.cpp.o: in function `std::filesystem::__cxx11::path::path<std::basic_string_view<char, std::char_traits<char> >, std::filesystem::__cxx11::path>(std::basic_string_view<char, std::char_traits<char> > const&, std::filesystem::__cxx11::path::format)':
Url.cpp:(.text._ZNSt10filesystem7__cxx114pathC2ISt17basic_string_viewIcSt11char_traitsIcEES1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC5ISt17basic_string_viewIcSt11char_traitsIcEES1_EERKT_NS1_6formatE]+0x64): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/urldedupe.dir/build.make:145: urldedupe] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/urldedupe.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

@ameenmaali
Copy link
Owner

ameenmaali commented Mar 22, 2021

Hey all, sorry for not getting back to this sooner. Hope you all were able to fix this on your own, but if you were not please see below:

(I recommend just bumping your compiler version if possible so you don't need these steps:

  1. Update #include <filesystem> to #include <experimental/filesystem> in Url.cpp
  2. Update std::filesystem::path fpath {this->path}; to std::experimental::filesystem::path fpath {this->path}; in Url.cpp has_extension() method.
  3. Lastly, add the following line link_libraries(stdc++fs) to CMakeLists.txt (after set(CMAKE_CXX_STANDARD 17)) to ensure library linking is setup properly for the experimental filesystem lib.

Dockerizing is a great idea however! And there's also some changes I can make to account for this, but don't have the time to make that at the moment so this should fix the initial build issues.

@pwnedDesal
Copy link

Hey all, sorry for not getting back to this sooner. Hope you all were able to fix this on your own, but if you were not please see below:

(I recommend just bumping your compiler version if possible so you don't need these steps:

  1. Update #include <filesystem> to #include <experimental/filesystem> in Url.cpp
  2. Update std::filesystem::path fpath {this->path}; to std::experimental::filesystem::path fpath {this->path}; in Url.cpp has_extension() method.
  3. Lastly, add the following line link_libraries(stdc++fs) to CMakeLists.txt (after set(CMAKE_CXX_STANDARD 17)) to ensure library linking is setup properly for the experimental filesystem lib.

Dockerizing is a great idea however! And there's also some changes I can make to account for this, but don't have the time to make that at the moment so this should fix the initial build issues.

I tried the solution, and I confirm this is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants