urldedupe icon indicating copy to clipboard operation
urldedupe copied to clipboard

make are not working

Open abdulsec opened this issue 4 years ago • 7 comments

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

abdulsec avatar Aug 12 '20 20:08 abdulsec

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..

larskraemer avatar Aug 16 '20 19:08 larskraemer

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 avatar Jan 29 '21 04:01 marcelo321

where is the binary..?

marcelo321 avatar Jan 29 '21 04:01 marcelo321

Not working for me either, same issue

ZultanH avatar Feb 11 '21 10:02 ZultanH

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

zeroc00I avatar Mar 18 '21 23:03 zeroc00I

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.

ameenmaali avatar Mar 22 '21 20:03 ameenmaali

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

pwneddesal avatar Apr 27 '21 01:04 pwneddesal