Software Archive
Read-only legacy content
17061 Discussions

Forcing linking with newer library

intelgg
Beginner
499 Views
I am building a console application (.exe).
The project links with a library that I specified
using 'Project Settings'/'Link'/'Input'.
I do wish do drag and drop the library into the
project view.

When the library is newer than the executable
and no source files have changed, I expect the
'build' command to cause the application to be
re-linked. But this does not happen.

What compiler/linker option do I need to set?
I do not mind doing this by typing an option
instead of just clicking a checkbox.

Thanks,
Gilles
0 Kudos
3 Replies
Steven_L_Intel1
Employee
499 Views
When you set the library that way, the build system doesn't see it - it's just a list of files given to the linker. The better way is to add the library to the project as if it were a source file. That way you don't even need to change the directories list.

Steve
0 Kudos
intelgg
Beginner
499 Views
Thank you Steve L. Then how do I do if I want to link the debug version of my application with the debug version of the library and the release version of the application with the release version of the library?
Gilles.
0 Kudos
Steven_L_Intel1
Employee
499 Views
The way I'd do this is to make the library project a subproject (dependent project) of your main project. Then when you build the main project, it will automatically rebuild the library if needed and will link to the appropriate variant.

Steve
0 Kudos
Reply