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. DLL problem

DLL problem

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiocomtesting
2 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.
  • A Offline
    A Offline
    Anatari
    wrote on last edited by
    #1

    I'm a newbie in creating DLL projects and can't seem to solve this problem. I am using a similar technique to Steve Driessen's article[^]. I'm trying to create a DLL that exports a couple of classes that uses some MFC collection objects, but I keep on getting this warning: warning C4251: 'CGifParser::m_aData' : class 'CArray' needs to have dll-interface to be used by clients of class 'CGifParser' (m_aData) is a CArray that is a member of CGifParser, the class I'm trying to export). The test program works correctly on a debug build, but not on a release build when testing the DLL. I'm just trying to create a simple library so that I can reuse the code in other projects easier. Visual Studio .Net complicates everything! I first attempted this by trying to create a static library (.lib) but I got all these duplicate declaration errors from the standard C++ libraries. I'm use to simple command line linkers on Unix =). Thanks. - Anatari

    M 1 Reply Last reply
    0
    • A Anatari

      I'm a newbie in creating DLL projects and can't seem to solve this problem. I am using a similar technique to Steve Driessen's article[^]. I'm trying to create a DLL that exports a couple of classes that uses some MFC collection objects, but I keep on getting this warning: warning C4251: 'CGifParser::m_aData' : class 'CArray' needs to have dll-interface to be used by clients of class 'CGifParser' (m_aData) is a CArray that is a member of CGifParser, the class I'm trying to export). The test program works correctly on a debug build, but not on a release build when testing the DLL. I'm just trying to create a simple library so that I can reuse the code in other projects easier. Visual Studio .Net complicates everything! I first attempted this by trying to create a static library (.lib) but I got all these duplicate declaration errors from the standard C++ libraries. I'm use to simple command line linkers on Unix =). Thanks. - Anatari

      M Offline
      M Offline
      moliate
      wrote on last edited by
      #2

      This means the base class (CArray) was not declared to be exported. Try adding a line like: template class __declspec(dllexport) CArray<_Arraydata_, _Arraydata_>; Hope that will fix it.. /moliate


      The corners of my eyes catch hasty, bloodless motion - a mouse? Well, certainly a peripheral of some kind.

      Neil Gaiman - Cold Colours

      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