|
From: David R. <dre...@mo...> - 2002-06-27 06:03:32
|
Yeah, it sucks pretty bad. I don't know if it is still true with the latest version of MSVC (MSVC.NET? MSVC7?).=20 The problem also applies to Category::getAllAppenders(). I'm not sure that the problem is so significant. It is only relevant to the win32 dll build: maybe the problem methods can be made private for that build? Or just put warnings in the documentation? Your solution to change the container returned to std::vector would be nice though... At least with getAllAppenders() it wouldn't break any production release APIs. Regards, David Resnick MobileSpear Inc. =20 -----Original Message----- From: Bastiaan Bakker [mailto:Bas...@li...]=20 Sent: Tuesday, June 25, 2002 10:35 To: David Resnick Cc: log...@li... Subject: Re: [Log4cpp-devel] Warning: win32 dll can't export containerclasses Hmm, that sucks. Any chance of MS fixing this problem soon? Being limited to only use std::vector in your APIs is ridiculous. However currrently only getCurrentCategories() is affected. It uses std::set now, but changing that to std::vector wouldn't hurt very much,=20 and may be more efficient as std::vector is the simplest container in most STL implementations. Yes, it's an incompatible API change, but 0.3.x is a development branch anyway.=20 Regards, Bastiaan PS. The above is not a commitment to keep the log4cpp API MSVC DLL export clean. =20 On Sun, 2002-06-23 at 10:08, David Resnick wrote: > I found this out when trying to use Category::getCurrentCategories(),=20 > which returns std::set<Category*>*. The set I got had 1 good pointer;=20 > the rest were invalid. >=20 > The problem is detailed by MS in Q168958 "HOWTO: Exporting STL=20 > Components Inside & Outside of a Class". Here is the key paragraph: >=20 > "Some STL classes contain nested classes. These classes can not be=20 > exported. For instance, deque contains a nested class deque::iterator. > If you export deque, you will get a warning that you must export=20 > deque::iterator. If you export deque::iterator, you get a warning that > you must export deque. This is caused by a designed limitation that=20 > once a template class is instantiated, it can not be re-instantiated=20 > and exported. The only STL container that can currently be exported is > vector. The other containers (that is, map, set, queue, list, deque)=20 > all contain nested classes and cannot be exported." >=20 > So if you want to use methods such as=20 > Category::getCurrentCategories(), do them in a helper class that is=20 > linked as part of the DLL. I added what I needed to the=20 > SimpleConfigurator (what I needed to do was delete previously defined=20 > appenders from all categories before reloading a config file, so it=20 > made sense in any case to put it there.) >=20 > Regards, >=20 > David Resnick > MobileSpear Inc.=20 >=20 >=20 >=20 > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/=20 > _______________________________________________ > Log4cpp-devel mailing list Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4cpp-devel |