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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Linking errors

Linking errors

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

    Hi There, I've spent a number of years away from C and C++ but recently decided to get back to it. I downloaded the latest VS2013 C++ and off I went. My challenge is that I cannot get the DLL I need to use to link in. I've generated a .def file using Dumpbin and then used that to create a .LIB for the DLL. I've put the lib in the Additional Dependencies of the Linker properties and added the directory to VC++ directories. It is definitely reading the lib because if I name it wrong then I get a can't find the lib error. I am still getting a LNK2019 unresolved externals message. I tried dumping the lib using dumpbin /EXPORTS and it has all the functions (though they are preceeded by _) I did even try using the _Functionname.. names in the code but still no luck. It feels like in the 10-15 years in between C++ should have got a lot easier. I sort of expected to just drop the dll in the project and off it would go. Hey ho, anyone that can point me at what I'm doing wrong I would be grateful Trevor

    Richard Andrew x64R 1 Reply Last reply
    0
    • T tre4

      Hi There, I've spent a number of years away from C and C++ but recently decided to get back to it. I downloaded the latest VS2013 C++ and off I went. My challenge is that I cannot get the DLL I need to use to link in. I've generated a .def file using Dumpbin and then used that to create a .LIB for the DLL. I've put the lib in the Additional Dependencies of the Linker properties and added the directory to VC++ directories. It is definitely reading the lib because if I name it wrong then I get a can't find the lib error. I am still getting a LNK2019 unresolved externals message. I tried dumping the lib using dumpbin /EXPORTS and it has all the functions (though they are preceeded by _) I did even try using the _Functionname.. names in the code but still no luck. It feels like in the 10-15 years in between C++ should have got a lot easier. I sort of expected to just drop the dll in the project and off it would go. Hey ho, anyone that can point me at what I'm doing wrong I would be grateful Trevor

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      I assume you're using a header file to describe the functions that live in the DLL? If so, try putting this around the function declarations:

      extern "C"
      {
      // Function declarations go here
      }

      The difficult we do right away... ...the impossible takes slightly longer.

      T 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        I assume you're using a header file to describe the functions that live in the DLL? If so, try putting this around the function declarations:

        extern "C"
        {
        // Function declarations go here
        }

        The difficult we do right away... ...the impossible takes slightly longer.

        T Offline
        T Offline
        tre4
        wrote on last edited by
        #3

        Hi Richard, Thank you very much, I knew it would be something simple I just could not see it! All linking okay now :-) Trevor

        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