So..........exporting STL containers from a dll?
-
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,
-
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,
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
-
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
-
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.
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!
-
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!
-
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,
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