From 9648a7894b10068806cd2662cedc7c60a5e741df Mon Sep 17 00:00:00 2001 From: mglord Date: Thu, 3 Jun 2021 14:01:25 -0400 Subject: [PATCH] Update HowToUseMSCL.md --- HowToUseMSCL.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/HowToUseMSCL.md b/HowToUseMSCL.md index 7fceeb976..51a850ef8 100644 --- a/HowToUseMSCL.md +++ b/HowToUseMSCL.md @@ -84,4 +84,11 @@ After installing the package, a folder was created in `/usr/share/` called `c++- This folder contains the MSCL headers, as well as a `boost` folder with the Boost library headers and libraries. You will need to tell your compiler to include these MSCL and Boost headers, as well as link to `libmscl.so`. For example: -```g++ -I/usr/share/c++-mscl/source -I/usr/share/c++-mscl/Boost/include YourFile.cpp -o YourProgram -L/usr/share/c++-mscl -lmscl -lstdc++ -std=c++11``` \ No newline at end of file +```g++ -I/usr/share/c++-mscl/source -I/usr/share/c++-mscl/Boost/include YourFile.cpp -o YourProgram -L/usr/share/c++-mscl -lmscl -lstdc++ -std=c++11``` + +#### A couple common issues: +**Build error:** `/usr/bin/ld: /usr/share/c++-mscl/libmscl.so: undefined reference to 'pthread_...` +*Resolution:* add `-pthread` argument prior to linking MSCL (`... -pthread -L/usr/share/c++-mscl...`) + +**Runtime error:** `error while loading shared libraries: libmscl.so: cannot open shared object file: No such file or directory` +*Resolution:* in addition to linking at compile time, the application also needs to be able to find MSCL at runtime. There are a few ways to resolve this, one of which is to specify the runtime MSCL path in the build command: `... -L/usr/share/c++-mscl -Wl,-rpath,/usr/share/c++-mscl...`