Giter Site home page Giter Site logo

dus's People

Contributors

livibetter avatar rijo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dus's Issues

Cannot compile using clang 3.7.0

The souce compiles using gcc-4.9 and gcc-5.3, but it won't compile using clang-3.7:

$ CXX=clang make
clang -std=c++14 -Wall -Werror -lpthread src/main.cpp -o dus
In file included from src/main.cpp:2:
In file included from src/fs.hpp:4:
In file included from /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/string:40:
In file included from /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/bits/char_traits.h:39:
In file included from /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/bits/stl_algobase.h:71:
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/bits/predefined_ops.h:123:31: error: indirection requires pointer operand
      ('fs::file_info' invalid)
        { return bool(_M_comp(*__it1, *__it2)); }
                              ^~~~~~
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/functional:1981:27: note: in instantiation of function template specialization
      '__gnu_cxx::__ops::_Iter_comp_iter<std::function<bool (const fs::file_info &, const fs::file_info &)> >::operator()<fs::file_info, fs::file_info>' requested here
        using _Invoke = decltype(__callable_functor(std::declval<_Functor&>())
                                 ^
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/functional:1990:2: note: in instantiation of template type alias '_Invoke' requested here
        using _Callable
        ^
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/functional:2057:30: note: in instantiation of template type alias '_Callable' requested here
               typename = _Requires<_Callable<_Functor>, void>>
                                    ^
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/functional:2058:2: note: in instantiation of default argument for
      'function<__gnu_cxx::__ops::_Iter_comp_iter<std::function<bool (const fs::file_info &, const fs::file_info &)> > >' required here
        function(_Functor);
        ^~~~~~~~
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/bits/predefined_ops.h:130:14: note: while substituting deduced template arguments into
      function template 'function' [with _Functor = __gnu_cxx::__ops::_Iter_comp_iter<std::function<bool (const fs::file_info &, const fs::file_info &)> >, $1 = (no value)]
    { return _Iter_comp_iter<_Compare>(__comp); }
             ^
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../include/c++/5.3.0/bits/stl_algo.h:4729:54: note: in instantiation of function template specialization
      '__gnu_cxx::__ops::__iter_comp_iter<std::function<bool (const fs::file_info &, const fs::file_info &)> >' requested here
      std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
                                                     ^
src/main.cpp:275:10: note: in instantiation of function template specialization 'std::sort<__gnu_cxx::__normal_iterator<fs::file_info *, std::vector<fs::file_info,
      std::allocator<fs::file_info> > >, std::function<bool (const fs::file_info &, const fs::file_info &)> >' requested here
    std::sort(files.begin(), files.end(), comparators[order_by]);
         ^
1 error generated.
Makefile:19: recipe for target 'dus' failed
make: *** [dus] Error 1

undefined reference to `pthread_create'

System: Ubuntu 15.10, gcc 5.2.1-22ubuntu2.

$ make
g++ -std=c++14 -Wall -Werror -Wextra -Wpedantic -Wshadow -lpthread src/main.cpp -o dus
/tmp/ccsK6DnM.o: In function `std::thread::thread<std::__future_base::_Async_state_impl<std::_Bind_simple<main::{lambda()#1} ()>, std::vector<fs::file_info_t, std::allocator<fs> > >::_Async_state_impl(main::{lambda()#1} (&&)())::{lambda()#1}>(std::__future_base::_Async_state_impl<std::_Bind_simple<main::{lambda()#1} ()>, std::vector<fs::file_info_t, std::allocator<fs> > >::_Async_state_impl(main::{lambda()#1} (&&)())::{lambda()#1}&&)':
main.cpp:(.text+0x9d6d): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
Makefile:19: recipe for target 'dus' failed
make: *** [dus] Error 1

Solution: Use -pthread instead of -lpthread (at least in gcc; I haven't tried clang/llvm).

And, well, since since that flag sets more than just the library, strictly speaking it is not part of LDLIBS anymore. ;)

Compilation error using g++-7.1.1 (-Werror=implicit-fallthrough=)

`[dus] (master) $git rev-parse HEAD
b6ff3d9
[dus] (master) $g++ --version
g++ (GCC) 7.1.1 20170516
Copyright © 2017 Free Software Foundation, Inc.
Detta är fri programvara, se källkoden för kopieringsvillkor. Det
finns INGEN garanti, inte ens för KÖP eller LÄMPLIGHET FÖR NÅGOT
SPECIELLT ÄNDAMÅL.

[dus] (master) $make
g++ -std=c++14 -Wall -Werror -Wextra -Wpedantic -Wshadow -pthread src/main.cpp -o dus
In file included from src/main.cpp:4:0:
src/console.hpp: I funktion ”const std::vectorconsole::arg_t console::parse_args(int, const char**)”:
src/console.hpp:272:39: fel: denna sats kan falla igenom [-Werror=implicit-fallthrough=]
args.emplace_back(arg_t{arg, "", nullptr});
^~~~~~~~~~~~~~~~~~~~~~~
src/console.hpp:273:17: anm: här
case 0:
^~~~
cc1plus: alla varningar behandlas som fel
make: *** [Makefile:19: dus] Fel 1`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.