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. Link Error Which .lib to include

Link Error Which .lib to include

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 Posts 3 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    Hi I have a Console C project that has a number of DLL's I got the following error when linking

    Quote:

    error LNK2001: unresolved external symbol _DllMainCRTStartup@12

    I am linking it as 64 bit How would I know what .lib to include by googling seemed it was MSVCRT.LIB but that didn't resolve my problem I remember once using dependency walker to resolve symbols but I think that was looking at .DLL to see what entry points were exposed Thanks

    L F 2 Replies Last reply
    0
    • F ForNow

      Hi I have a Console C project that has a number of DLL's I got the following error when linking

      Quote:

      error LNK2001: unresolved external symbol _DllMainCRTStartup@12

      I am linking it as 64 bit How would I know what .lib to include by googling seemed it was MSVCRT.LIB but that didn't resolve my problem I remember once using dependency walker to resolve symbols but I think that was looking at .DLL to see what entry points were exposed Thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Check the documentation for the DLL methods that you are calling. For example Google can find you https://www.google.com/search?q=DllMainCRTStartup[^].

      F 1 Reply Last reply
      0
      • F ForNow

        Hi I have a Console C project that has a number of DLL's I got the following error when linking

        Quote:

        error LNK2001: unresolved external symbol _DllMainCRTStartup@12

        I am linking it as 64 bit How would I know what .lib to include by googling seemed it was MSVCRT.LIB but that didn't resolve my problem I remember once using dependency walker to resolve symbols but I think that was looking at .DLL to see what entry points were exposed Thanks

        F Offline
        F Offline
        Frankie C
        wrote on last edited by
        #3

        If you are linking for 64bits the entry point for dll should be _DllMainCRTStartup (undecorated entry point). If you get this error probably there is a error in linker switches because it seems that you are trying to use 64 bits objects in a 32bits link. It is not very clear in which part of your project you're getting the error: compiling the console exe or one of the DLL?

        1 Reply Last reply
        0
        • L Lost User

          Check the documentation for the DLL methods that you are calling. For example Google can find you https://www.google.com/search?q=DllMainCRTStartup[^].

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          Thank you again Richard the problem was in my win32.mak I have amd64 cpu and for some reason win32 it was i386 thus generating @12 ordinal for The DLL startup entry point still trying to finish building

          F 1 Reply Last reply
          0
          • F ForNow

            Thank you again Richard the problem was in my win32.mak I have amd64 cpu and for some reason win32 it was i386 thus generating @12 ordinal for The DLL startup entry point still trying to finish building

            F Offline
            F Offline
            Frankie C
            wrote on last edited by
            #5

            So I was right 64bits objs and 32bits linking... :)

            F 1 Reply Last reply
            0
            • F Frankie C

              So I was right 64bits objs and 32bits linking... :)

              F Offline
              F Offline
              ForNow
              wrote on last edited by
              #6

              Yes thanks

              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