Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Random Linker Error

Random Linker Error

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiocomdebugging
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zac Howland
    wrote on last edited by
    #1

    I have an ActiveX control that I wrote a while ago. It compiled fine then, but when I accidently hit "Rebuild All" today, I got the following output: --------------------Configuration: PilotImport - Win32 Debug-------------------- Creating Type Library... Processing C:\My Projects\Completed Components\PilotImport\PilotImport.odl PilotImport.odl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl oaidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl objidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl unknwn.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl wtypes.idl Compiling resources... Compiling... StdAfx.cpp Compiling... Pilot_Import.c PilotImport.cpp PilotImportCtl.cpp PilotImportPpg.cpp Linking... mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj) mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj); second definition ignored Creating library Debug/PilotImport.lib and object Debug/PilotImport.exp Debug/PilotImport.ocx : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. PilotImport.ocx - 2 error(s), 1 warning(s) Nothing in the code has changed -- does anyone know why this linker error suddenly popped up? I got around this with another project by completely remaking the project, but this requires a lot of retyping. Thanks Zac "If I create everything new, why would I want to delete anything?"

    Z 1 Reply Last reply
    0
    • Z Zac Howland

      I have an ActiveX control that I wrote a while ago. It compiled fine then, but when I accidently hit "Rebuild All" today, I got the following output: --------------------Configuration: PilotImport - Win32 Debug-------------------- Creating Type Library... Processing C:\My Projects\Completed Components\PilotImport\PilotImport.odl PilotImport.odl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl oaidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl objidl.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl unknwn.idl Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl wtypes.idl Compiling resources... Compiling... StdAfx.cpp Compiling... Pilot_Import.c PilotImport.cpp PilotImportCtl.cpp PilotImportPpg.cpp Linking... mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj) mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj); second definition ignored Creating library Debug/PilotImport.lib and object Debug/PilotImport.exp Debug/PilotImport.ocx : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. PilotImport.ocx - 2 error(s), 1 warning(s) Nothing in the code has changed -- does anyone know why this linker error suddenly popped up? I got around this with another project by completely remaking the project, but this requires a lot of retyping. Thanks Zac "If I create everything new, why would I want to delete anything?"

      Z Offline
      Z Offline
      Zac Howland
      wrote on last edited by
      #2

      Nevermind, I found out why it is doing this. As it turns out, this is caused by the CRT being linked before MFC (I still don't understand how it gets in a state where this occurs since nothing had changed in the code, but oh well). The solution is in a knowledge base article: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q148652& "If I create everything new, why would I want to delete anything?"

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups