VS2017 Linux C + + referencing a custom dynamic library

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.