0

I have a c++ .dll project that was created in Visual Studio 2010 a few years ago. Its comprised of 4 .lib projects and 1 .dll project. Everything is statically linked so as to not require redistributables to be deployed on the host machine. Its been maintained over the years but we'd like to update all our compilers to Visual Studio 2015. Never as easy as it sounds.

I've opened the solution file in Visual Studio 2015 and it performed a quick conversion I suppose. However, when I build, I get these 2 errors.

LNK2005 ___report_gsfailure already defined in EasyHook32.lib(gs_report.obj)    .....\LIBCMT.lib(gs_report.obj)

LNK1169 one or more multiply defined symbols found

So, I suppose my biggest question is, how can upgrading from VS2010 to VS2015 magically cause a link error all of a sudden? Also, how can I resolve this link issue?

Ultratrunks
  • 2,464
  • 5
  • 28
  • 48
  • Are the libraries including each other – cup Apr 27 '16 at 17:13
  • 1
    Make sure that in Visual Studio 2015 you are not using any libraries that were compiled with Visual Studio 2010. – drescherjm Apr 27 '16 at 17:26
  • Probably the 2010 project defined the `/FORCE:MULTIPLE` linker command. https://msdn.microsoft.com/en-us/library/70abkas3.aspx?f=255&MSPPError=-2147217396 – AndyG Apr 27 '16 at 17:26
  • Yes, some of the libraries do include each other. Keep in mind this has compiled for years in VS2010 – Ultratrunks Apr 27 '16 at 17:26
  • @AndyG, I'm looking at the 2010 build and it does not appear that `/FORCE:MULTIPLE` command is set. – Ultratrunks Apr 27 '16 at 17:37
  • @Ultratrunks: Then perhaps there were preprocessor statements that controlled whether a symbol would get created or not, and after the upgrade, those preprocessors don't behave as before. If it's at all possible to create a [mcve], then we'd be able to help better, but I understand the difficulties with all the metadata surrounding VS projects. – AndyG Apr 27 '16 at 17:40

0 Answers0