9

I have a project that is linking to an external .lib (libprotobuf.lib). When I compile in release, there are no warnings. When I compile in debug though, I receive this warning:

warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
File: \libprotobuf.lib(message_lite.obj)

I have been researching the problem, starting with this question. I have been tweaking my project's options, and I have (in the debug configuration):

/Zi - So edit and continue should not be on.

/INCREMENTAL - So incremental should be on.

Any ideas why I'm still getting this warning? My best guess is that the external lib was built with /ZI on... but I don't understand why it would be a problem if I have /INCREMENTAL on. Thanks in advance for your help!

UPDATE: I was able to rebuild the external library with the /Zi option instead of the /ZI... which solved my problem, but I would greatly appreciate it if someone could tell me why. Why in my original project, with /INCREMENTAL on, did the warning still appear as given? Thanks!

Community
  • 1
  • 1
TheBlueRage
  • 191
  • 1
  • 1
  • 6

2 Answers2

0

OP posted the fix as an update. I can confirm this is the fix as I had the same issue and fixed as suggested. The issue is in the consumed lib not in the project that the error identifies. Consumed lib must be built without /ZI (upper i), and /Zi (lower i) seems a good option.

The confusing aspect of the error is that the context project has /INCREMENTAL (which seems to be the opposite of /INCREMENTAL:NO) and /Zi (which seems to not be editandcontinue). So, the error message seems wrong. But, the file context is the clue that the issue is in the consumed lib.

To confirm, the error context is:

  • Project: consuming project
  • File: consumed lib file (some .obj file)
E_net4
  • 27,810
  • 13
  • 101
  • 139
steve
  • 1,021
  • 1
  • 14
  • 29
-1

I think it's pretty straight forward. /Zi option is dependent on /INCREMENTAL and if you turn that off, the compiler warns about it. (The warning you mentioned is when it compiles the external library, as per the error message). So the warning is about the external library's configuration problem.

Soundararajan
  • 2,000
  • 21
  • 23
  • 3
    But that's just it - /INCREMENTAL is ON, not off. Sorry if I'm just not understanding, but I'm still confused. – TheBlueRage Jan 06 '14 at 13:31
  • This answer is misleading at best. "The warning ... is when it compiles the external library" implies that the warning is _generated_ when the external lib is compiled ... but it's an external lib which implies that OP is not building it. The warning is generated when the consuming project is built. The build complains that the consumed lib was built with incompatible/illogical settings. But, the last sentence is right: the warning is about the external library's config. It must be re-built with different config. – steve Dec 23 '22 at 03:51