views:

35

answers:

1

In Microsoft Visual Studio 2010, I use the wizard to create a solution with two projects:
- theapp: a C++ Win32 console app, and
- thelib: a C++ static library

I add an h-file and a cpp-file to the library and write a do-nothing function in thelib.
In main(), I call thefunc().

In project/dependencies theapp is set to depend on thelib.

To my surprise, the solution does not link: the linker does not find thefunc().

In previous versions of Visual Studio, the dependency automagically caused theapp
to be linked with thelib, but it seems it is no longer the case in 2010.

Am I doing something wrong?
What is the 'right' way to automagically achieve the desired linkage in 2010?

A: 

Yes, this is done differently now. They call it a "project-to-project dependency". Not actually sure what that means. Right-click the EXE project, Properties, Common Properties, Framework and References. Click the Add New Reference button and select your .lib project.

The "Link Library Dependencies" should be set to True, it is by default. You no longer have to use the old "Project Dependencies" dialog anymore, it sorts out the build order from the new step.

Hans Passant