The previous blog tells the example of using the system library libpthread.so, only need to add corresponding parameters (such as-pthread) to the [c++-> command line parameters of the Project property page and the [linker] command line parameters]. Then I try to reference my own library (libtlpi.so, which is placed in the/lib directory), and then add-ltlpi to the command-line arguments, and find that the custom dynamic library cannot be referenced, undefined reference error.
On the internet for a long time, have not found a solution, and finally the official thoughtful, in the VS home Tutorial has
Since OpenGL was previously configured, it is immediately visible that GL, GLU, and glut represent OpenGL's three. so files (libgl.so, libglu.so, libglut.so), and then I find that the description of VS is a pit.
I thought the library dependencies here can only enter the static library, the original is my temporary eye ... The prefix for Lib is the dynamic library libxxx.so, I first thought that is the static library Xxx.lib windows, because the previous configuration OpenCV when the routine is to enter the static library (*.lib file) name in the [linker-input], and then the dynamic library (*. DLL) is located directly through the environment variable.
While remotely debugging Linux, dynamic library libxxx.so and Static library xxx.a are all configured in [linker-input]
Therefore, you do not have to add the-LTLPI option in the [c++-> command line arguments], [linker-and command-line arguments].
Finally, the code is streamlined, the compilation runs successfully, and finally it can be developed directly with VS completely instead of Linux (not necessarily, remote control is faster or slower than local direct command compilation)
VS2017 Linux C + + referencing a custom dynamic library