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. problem with dll

problem with dll

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
3 Posts 2 Posters 1 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
    dolph_loe
    wrote on last edited by
    #1

    In a dll, I define a class in the following way: class _declspec(dllexport) jalla { std::list m_mesh; }; but when I try to compile it, I get the warning: e:\Work\C++\Project\3DGame\3DSLoader.h(19) : warning C4251: 'jalla::m_mesh' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'jalla' with [ _Ty=int ] what is happening? øivind

    D 1 Reply Last reply
    0
    • D dolph_loe

      In a dll, I define a class in the following way: class _declspec(dllexport) jalla { std::list m_mesh; }; but when I try to compile it, I get the warning: e:\Work\C++\Project\3DGame\3DSLoader.h(19) : warning C4251: 'jalla::m_mesh' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'jalla' with [ _Ty=int ] what is happening? øivind

      D Offline
      D Offline
      dolph_loe
      wrote on last edited by
      #2

      the class is like this: class _declspec(dllexport) jalla { std::list<int> m_mesh; }; øivind

      J 1 Reply Last reply
      0
      • D dolph_loe

        the class is like this: class _declspec(dllexport) jalla { std::list<int> m_mesh; }; øivind

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        It means that the instance std::list<int> needs to have a dllexport attribute on it in order to be safely usable by clients. Just like you are tagging jalla with dllexport. As you may understand, exposing STL datatypes through a DLL interface is not easy. I don't know any good workarounds for it, other than using a non templated and exportable type/class. Sorry. :( -- Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr. Welle: Erdball - F104-G Starfighter

        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