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. STL container over DLL Export

STL container over DLL Export

Scheduled Pinned Locked Moved C / C++ / MFC
c++htmldesigndockerbusiness
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.
  • P Offline
    P Offline
    peterchen
    wrote on last edited by
    #1

    Hi, I try to DLLExport a C++ class that contains an STL container, which gives a a compiler warning. I have "half of an idea" about the why, but it's a bit fuzzy. I recently found a MSKB article describing what to do in this case - however, I cannot find it anymore. Any suggestions?


    we are here to help each other get through this thing, whatever it is Vonnegut jr.
    sighist || Agile Programming | doxygen

    V 1 Reply Last reply
    0
    • P peterchen

      Hi, I try to DLLExport a C++ class that contains an STL container, which gives a a compiler warning. I have "half of an idea" about the why, but it's a bit fuzzy. I recently found a MSKB article describing what to do in this case - however, I cannot find it anymore. Any suggestions?


      we are here to help each other get through this thing, whatever it is Vonnegut jr.
      sighist || Agile Programming | doxygen

      V Offline
      V Offline
      vmaltsev
      wrote on last edited by
      #2

      I presume you're talking about warning 4251. "If your project declares a class class __declspec(dllexport), and that class has members of the std::* type, you see C4251 warnings. Because all your code is built with the std::* class now statically linked, you can ignore these warnings. To explicitly disable those warnings, use the following notation: #pragma warning(disable: 4251)" This is what I do, and I've never had any problems with it. Hope it'll help you as well.

      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