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. ATL / WTL / STL
  4. So..........exporting STL containers from a dll?

So..........exporting STL containers from a dll?

Scheduled Pinned Locked Moved ATL / WTL / STL
c++graphicshelpquestion
6 Posts 4 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
    Abebe
    wrote on last edited by
    #1

    I don't seem to have a problem exporting STL containers from a dll, but when i try to export a std::map that contains std::vector's, it somehow doesn't work. I've read the whole article provided by Mircosoft, but it does not discusses the problem that i'm having. Perhaps it has something to do with the fact that i've defined a map that contains others containers (nested structure). Has anybody encountered the same problem and perhaps enlighten me? Many thanks in advance,

    J P 2 Replies Last reply
    0
    • A Abebe

      I don't seem to have a problem exporting STL containers from a dll, but when i try to export a std::map that contains std::vector's, it somehow doesn't work. I've read the whole article provided by Mircosoft, but it does not discusses the problem that i'm having. Perhaps it has something to do with the fact that i've defined a map that contains others containers (nested structure). Has anybody encountered the same problem and perhaps enlighten me? Many thanks in advance,

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      There's a known bug in Dinkumware's STL implementation (the one that comes with MSVC) which shows when attempting to export STL containers from a DLL. Check Dinkumware STL library fix section[^], and particularly the paragraph "Fix to <xtree>". Be careful when applying the fix (do a backup!) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      A 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        There's a known bug in Dinkumware's STL implementation (the one that comes with MSVC) which shows when attempting to export STL containers from a DLL. Check Dinkumware STL library fix section[^], and particularly the paragraph "Fix to <xtree>". Be careful when applying the fix (do a backup!) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        A Offline
        A Offline
        Abebe
        wrote on last edited by
        #3

        i've just done some reading, and i don't think it is possible to export any STL container from a DLL, besides std::vector. This, ofcourse, is annoying as hell.

        A 1 Reply Last reply
        0
        • A Abebe

          i've just done some reading, and i don't think it is possible to export any STL container from a DLL, besides std::vector. This, ofcourse, is annoying as hell.

          A Offline
          A Offline
          Alexandru Savescu
          wrote on last edited by
          #4

          I was able to export all types of containers from a DLL. Of course I applied the patch Joaquin is talknig about and it works perfectly. BTW, the problems are fixed in VC 7.0. Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

          A 1 Reply Last reply
          0
          • A Alexandru Savescu

            I was able to export all types of containers from a DLL. Of course I applied the patch Joaquin is talknig about and it works perfectly. BTW, the problems are fixed in VC 7.0. Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

            A Offline
            A Offline
            Abebe
            wrote on last edited by
            #5

            hmm...alright.....he i was wondering about VC7.0, thanks for clearing that up.

            1 Reply Last reply
            0
            • A Abebe

              I don't seem to have a problem exporting STL containers from a dll, but when i try to export a std::map that contains std::vector's, it somehow doesn't work. I've read the whole article provided by Mircosoft, but it does not discusses the problem that i'm having. Perhaps it has something to do with the fact that i've defined a map that contains others containers (nested structure). Has anybody encountered the same problem and perhaps enlighten me? Many thanks in advance,

              P Offline
              P Offline
              Phil Martin
              wrote on last edited by
              #6

              The VC6 implementation of std::map's is very annoying across DLL boundaries. It uses some static members to keep track of sentinel values for the map. This means each DLL that uses a std::map will have different values, and causes the tree walking to much up because those values never match up. To fix this problem for me, I used STLPort. http://www.stlport.org[^] It solved all my stl dll problems, and even got a bonus hash-map to use. Yay! The other alternative (which I was using for a while) was to never pass stl containers around, and just try to have a plain interface wrapping them all. It wasn't much fun. Phil

              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