Developing shared libraries with eclipse CDT

Source: Internet
Author: User
Consider the following not so uncommon scenario: You have a shared library project in eclipse and an executable project which uses the shared library.

I found that you have to do some additional things for building, running and debugging the executable project in eclipse (note that I'm doing this on Linux using CDT 4.0.3 ):

Define Your shared library's project as a reference for your application. in order to do so open the project properties of the executable project, go to project references and select the Shared Library Project (where in my case "shared" is also the name of the shared library ).

In the project settings of your executable project, add the Shared Library to the linker settings, as shown in the following screenshot:

Bear in mind that the library search path must be adjusted every time when switching between debug and release versions.

In the project settings of your executable project, add the working directory of your shared library project to the compiler include path, as shown in this screenshot:

Now you shoshould be able to compile your application, but in order to run it from within eclipse, there's a last step that needs to be done:

In the run dialog (top menu run-> open run dialog), defineLD_LIBRARY_PATHVariable$ {Workspace_loc}/shared/debug/, As shown inthe following screenshot.

Again, this needs to be adjusted when switching between debug and release versions.

All this is very tedious stuff, so hopefully this will be a bit improved in the upcoming CDT releases.

Popularity: 90%[?]

 

Link to: http://dirkraffel.com/2008/06/27/developing-shared-libraries-with-eclipse-cdt/

 

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.