0

For a C++ project in Visual Studio 2010, that I have took back recently, I don't remember why I have two locations to define the output of the build:

  • first in project's Properties > Configuration Properties > General > Output Directory + Target Name + Target type.
  • second, in one shot, in project's Properties > Configuration Properties > Linker (or Librarian) > Output File.

I noted that the two can be different, thus what defines each? Also, from time to time, when I get into some "tinkering" I get the build error that the target doesn't match the link properties.

If anyone can clarify me that, I appreciate! Thanks

Ginger Opariti
  • 1,282
  • 5
  • 23
  • 41

2 Answers2

0

Found it: yes, they should be identical. It seems to be a VS redundancy but I guess it helps to double-checking.

Ginger Opariti
  • 1,282
  • 5
  • 23
  • 41
0

Yes, they should be identical.

But there is a better option: use macros to ensure that Linker → General → Output File has the value it is supposed to. The Project Wizard does this for you by default, setting "Output File" to:

$(OutDir)$(TargetName)$(TargetExt)

That way, they never drift. If you update the properties on the main screen, the linker settings get automatically updated.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • Ha, ha, I was going to include the same remark, which is not an option but a correct use. No problem to award you the answer :-)! – Ginger Opariti Feb 16 '16 at 11:34