Closed XinzhaoZHU closed 4 years ago
@XinzhaoZHU, thank you for your feedback. Do you mean that the following code in CMakeLists.txt doesn't work on WSL2 environment?
Since I don't have WSL2 environment yet, could you send a pull request including your fix? Thanks for your help!
The pull request have been issued.
I aslo checked the original one. It seems only the peglint binary would have no pthread link against when checking with ldd. Other binary files, calc* and test-main are all ok, on my WSL2 platform, with Ubuntu 20.04, CMAKE 3.16.3 and GCC 9.3.0.
After using Threads library, it's all okay. But it is still very strange to see this case.
@XinzhaoZHU, I have just merged your pull request. Thanks for your help!
When building on wsl2, it seems the peglint doesn't link against to the pthread library even when the cmake asks to link against pthread library in the CMake files. It's caused by a potential bug for Linux platform when using multiple-thread library. And it may be confused to see such a result.
to refine it, please use
inner the main CMake, and for application like peglint, use
This will add option
-pthread
for both of the comipler and linker(not-lpthread
only on linker), and it would solve the problem of linking against pthread issue on linux platform.