Giter Site home page Giter Site logo

Comments (12)

bshoshany avatar bshoshany commented on May 11, 2024

You forgot to add the -std=c++17 flag.

from thread-pool.

brunolnetto avatar brunolnetto commented on May 11, 2024

Do you mean gcc -Wall -Wpedantic -Wextra -Wconversion -Weffc++ -std=c++17 thread_pool_test.cpp ? I still receive many errors...

http://codepad.org/PtgUzwfa

from thread-pool.

bshoshany avatar bshoshany commented on May 11, 2024

Sorry, I have no idea why you're getting all these errors. Did you make any changes to the code? If so, please compile the original source code from the GitHub repository and see if that works. If not, I would recommend reinstalling GCC, as some of its files may be missing or corrupted. I tested the library using GCC 9.4.0 on CentOS Linux 7.6.1810 and had no issues.

from thread-pool.

brunolnetto avatar brunolnetto commented on May 11, 2024

May you instruct me on how do I rebuild it from the repository?

from thread-pool.

bshoshany avatar bshoshany commented on May 11, 2024

Just download the repository, extract it to an empty folder, and then compile the .cpp file.

from thread-pool.

brunolnetto avatar brunolnetto commented on May 11, 2024

By compilation, do you mean "Run the command on post comment"

from thread-pool.

bshoshany avatar bshoshany commented on May 11, 2024

No. As I said, you need to compile with the -std=c++17 flag. The full command will be:

g++ thread_pool_test.cpp -std=c++17 -o thread_pool_test

You can add warning flags if you want to, but they are not necessary to compile the program.

EDIT: Changed gcc to g++ (see below).

from thread-pool.

brunolnetto avatar brunolnetto commented on May 11, 2024

I did as you said:

  1. Download the latest release zip file;
  2. Unzip in some folder;
  3. Open terminal and navigate to the folder;
  4. Run command gcc thread_pool_test.cpp -std=c++17 -o thread_pool_test

I still receive this zillions of errors: http://codepad.org/yloo9wPh

from thread-pool.

bshoshany avatar bshoshany commented on May 11, 2024

I'm sorry, unfortunately I have no idea why you're getting these errors :( I suggest trying a newer version of GCC or a different compiler altogether (e.g. Clang). If that doesn't work either, please ask for help on StackOverflow.

from thread-pool.

AlexanderSerov avatar AlexanderSerov commented on May 11, 2024

Hi @brunolnetto
I try to reproduce issue myself and indeed it's not compiled with suggested command. The errors supplied by you in codepad point out that it missed c++ standard library symbols which must be linked by default. Changing gcc to g++ made the trick (read about difference on stackoverflow). And one more flag to compiler required -pthread
Full command:
g++ thread_pool_test.cpp -std=c++17 -pthread -o thread_pool_test

from thread-pool.

bshoshany avatar bshoshany commented on May 11, 2024

LOL, I'm a total idiot! 😅 I didn't even notice you were using gcc instead of g++ and I even used that in my own example. Of course, gcc only compiles C code, while g++ compiles C++ code, and this library is in C++, not C. I definitely should have realized that before. Thanks @AlexanderSerov.

from thread-pool.

brunolnetto avatar brunolnetto commented on May 11, 2024

We are all educated idiots. I suggest to shrink the README content and add the command provided by @AlexanderSerov on his commment.

My advice as potential user is to move a great amount of details from README information to the Wiki section. Try to summarize the essentials and easy-to-use instructions and then provide the Wiki URL to the user to decide if he wants to continue on a deep-dive of your library.

from thread-pool.

Related Issues (20)

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.