Comments (12)
You forgot to add the -std=c++17
flag.
from thread-pool.
Do you mean gcc -Wall -Wpedantic -Wextra -Wconversion -Weffc++ -std=c++17 thread_pool_test.cpp
? I still receive many errors...
from thread-pool.
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.
May you instruct me on how do I rebuild it from the repository?
from thread-pool.
Just download the repository, extract it to an empty folder, and then compile the .cpp
file.
from thread-pool.
By compilation, do you mean "Run the command on post comment"
from thread-pool.
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.
I did as you said:
- Download the latest release zip file;
- Unzip in some folder;
- Open terminal and navigate to the folder;
- 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.
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.
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.
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.
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)
- [BUG] shared_ptr is not being copied in parallelize_loop HOT 6
- [REQ] Getting thread ids HOT 3
- Performance very slow HOT 1
- Task Priority HOT 4
- [REQ] Balanced workload for push_loop HOT 1
- [REQ] Document unexpected cleanup of tasks in worker HOT 1
- [BUG ?] multiple definitions get_index, get_pool link fails with VS 2022 HOT 4
- Support Task Prepending (executing higher priority tasks first) HOT 1
- Place private classes at head of file HOT 2
- Error linking with version 4.0.0 HOT 1
- [REQ] Q? HOT 1
- [REQ] Allow compiling with exceptions disabled. HOT 8
- [REQ] Can the threads in a pool be pinned to specific cores? HOT 1
- [REQ] ability to set threads to 0, and have everything execute serially HOT 3
- [REQ] does this library support recursive/nested tasks? HOT 5
- [REQ] Explain destructor behavior for thread_pool HOT 4
- [REQ] Add compiler flag/define to make threadpool use a stack instead of queue HOT 3
- Get rid of shared pointer for submitted tasks promises HOT 1
- [REQ] Wait on any task in multi_future and thread_pool HOT 2
- [BUG] Thread pool is NOT avaliable when it was created. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thread-pool.