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. Using a Self Developed Dll in VC++

Using a Self Developed Dll in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiocomjsonhelp
3 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.
  • D Offline
    D Offline
    Django_Untaken
    wrote on last edited by
    #1

    Hello guys. I am trying to make and use a dll in VC++. I am following this sample. The dll compiles successfully. But when I try to integrate it's .dll, .lib and .h files in another project, then it gives me 5 linker errors. One of them is Error LNK2019 and rest are Error LNK2001. Couple of them look like this

    1 - error LNK2019: unresolved external symbol "public: __thiscall CMyClass::CMyClass(void)" referenced in function "public: __thiscall CClientDlg::CClientsDlg(class CWnd *)" // occuring in DLG class

    2 - error LNK2001: unresolved external symbol "public: __thiscall CMyClass::~CMyClass(void)" // occuring in DLG class

    Just to let you know, I make a new folder and put all the said files in it. Then I add this path to the following properties + Properties-> Linker-> General-> Additional Library Directories + Properties-> C/C++-> General-> Additional Include Libraries What could I be doing wrong here? Thanks for any pointer.

    L A 2 Replies Last reply
    0
    • D Django_Untaken

      Hello guys. I am trying to make and use a dll in VC++. I am following this sample. The dll compiles successfully. But when I try to integrate it's .dll, .lib and .h files in another project, then it gives me 5 linker errors. One of them is Error LNK2019 and rest are Error LNK2001. Couple of them look like this

      1 - error LNK2019: unresolved external symbol "public: __thiscall CMyClass::CMyClass(void)" referenced in function "public: __thiscall CClientDlg::CClientsDlg(class CWnd *)" // occuring in DLG class

      2 - error LNK2001: unresolved external symbol "public: __thiscall CMyClass::~CMyClass(void)" // occuring in DLG class

      Just to let you know, I make a new folder and put all the said files in it. Then I add this path to the following properties + Properties-> Linker-> General-> Additional Library Directories + Properties-> C/C++-> General-> Additional Include Libraries What could I be doing wrong here? Thanks for any pointer.

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

      You have a reference to the constructor of CMyClass In your application, but it is not exported in the dll. See http://msdn.microsoft.com/en-us/library/ms235636.aspx[^] for details.

      1 Reply Last reply
      0
      • D Django_Untaken

        Hello guys. I am trying to make and use a dll in VC++. I am following this sample. The dll compiles successfully. But when I try to integrate it's .dll, .lib and .h files in another project, then it gives me 5 linker errors. One of them is Error LNK2019 and rest are Error LNK2001. Couple of them look like this

        1 - error LNK2019: unresolved external symbol "public: __thiscall CMyClass::CMyClass(void)" referenced in function "public: __thiscall CClientDlg::CClientsDlg(class CWnd *)" // occuring in DLG class

        2 - error LNK2001: unresolved external symbol "public: __thiscall CMyClass::~CMyClass(void)" // occuring in DLG class

        Just to let you know, I make a new folder and put all the said files in it. Then I add this path to the following properties + Properties-> Linker-> General-> Additional Library Directories + Properties-> C/C++-> General-> Additional Include Libraries What could I be doing wrong here? Thanks for any pointer.

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        Is that one of your export classes? ...how is it defined in the header? ...make sure you've labeled it as an import (that's the declspec part of the example) in the header file. One thing I noticed about that example is that it's exporting functions, not really exporting classes. Difference is the constructor, if you're exporting/importing a whole class, this[^] is the way to do it. Look at the section labeled as "C++ Native Approach: Exporting a Class".... although it wouldn't hurt to read the whole article so you know get as much info as possible.

        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