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. Question about dll

Question about dll

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 12 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.
  • R Offline
    R Offline
    Roy Xu
    wrote on last edited by
    #1

    I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error: error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z) When I look at the dll, I see ... 314 139 00001131 ?function@testclass@@QAEXPBG@Z Apparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?

    A 1 Reply Last reply
    0
    • R Roy Xu

      I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error: error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z) When I look at the dll, I see ... 314 139 00001131 ?function@testclass@@QAEXPBG@Z Apparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?

      A Offline
      A Offline
      Alex Gorev
      wrote on last edited by
      #2

      Hi! You have to declare the class as "__declspec(dllimport)". And you also have to include the *.LIB file for your DLL. You can do this in the Link section of your project settings or by inserting the pragama in the source code. For example: #pragma comment(lib, "MyClass.lib") Regards, Alex Gorev, Dundas Software. ================== The original message was: I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error:
      error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z)

      When I look at the dll, I see

      ...
      314 139 00001131 ?function@testclass@@QAEXPBG@Z

      Apparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?

      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