Creating Dependencies Between C or C++ Projects

See Also 

A C or C++ application or dynamic library often depends on static or dynamic libraries that are linked with the object code by the linker. These libraries can be separate projects that you designate as related projects of your C or C++ Application project. Whenever you clean and build the project, the IDE also cleans and builds the related projects.

Clicking a function hyperlink in a project with dependencies causes the editor to jump to the function definition if the definition is located in an open dependent project. If the dependent project that contains the definition is closed, the editor jumps to the function declaration.

The procedure for adding project dependencies is a little different for managed projects created in the IDE, and unmanaged projects created from existing sources.

To add a project dependency to an application or dynamic library managed project:

  1. In the Projects window, right-click the project and choose Properties.
  2. In the Project Properties dialog box, select the Linker node.
  3. In the Libraries panel, click the browse button.
  4. In the Libraries dialog box, click Add Project.
  5. In the Add Project dialog box, select the library project on which your Application project depends, and then select a Configuration if the project has multiple configurations.
  6. Click Add.
  7. If you do not want the project to be built every time the dependent project is built, deselect the Build checkbox to remove the check mark.
  8. Click OK in the Libraries dialog box and the Project Properties dialog box.

To add a project dependency to an unmanaged project from existing sources:

  1. In the Projects window, right-click the project and choose Properties.
  2. In the Project Properties dialog box, select Related projects.
  3. In the Related projects panel, click the browse button.
  4. In the Projects dialog box, click Add.
  5. In the Add Project dialog box, select the project on which your project from existing sources depends, and then select a Configuration if the project has multiple configurations.
  6. Click Add Project.
  7. If you want the project to be built every time the dependent project is built, select the Build checkbox to add a check mark.
  8. Click OK in the Projects dialog box and the Project Properties dialog box.
See also
Libraries Dialog Box

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.