From: Michael G. <mg...@te...> - 2007-06-14 11:03:20
|
> > suppose i have a utility function that uses for example > > std::vector, or std::string, or anyother C++ stndard libraries as a > > parameter I dont want to export this function to dll, but its being > > used by the exported functions internally, is this ok, or it also > > must have pure c api, >=20 > I *think* this should be OK. That's what I meant when I said "Internal > implementation might use C++". Experiment! I'm using this regularly and it works without problems. Inside the DLL you can basically use whatever you want. Generally when mixing DLLs created by different compilers you should be aware you might in fact be using different runtime libraries. If that happens you should be aware of the following possibly incomplete list of caveats: =2D don't mix malloc/free among different RT libs =2D don't mix stdio among different RT libs =2D when dealing with floating point different RT libs install and reinstall different floating point exception handlers. Be sure to call _fpreset() where appropriate (e.g. in the wrapping code). The above probably does not apply to mixing MinGW and MSVC because they should use the same RT libs but it definitely applies to mixing either of the two with other compilers (e.g. Borland or IBM VAC). Best, Michael =2D-=20 Technosis GmbH, Gesch=E4ftsf=FChrer: Michael Gerdau, Tobias Dittmar Sitz Hamburg; HRB 89145 Amtsgericht Hamburg Vote against SPAM - see http://www.politik-digital.de/spam/ Michael Gerdau email: mg...@te... GPG-keys available on request or at public keyserver |