> What I really want to know is what has worked for you when organizing a
> project that uses stl and managed code.
> Any help would be greatly appreciated.
I've done this successfully. I have general purpose libraries written in
standard C++, which I can use in any unmanaged project, with any
compiler. It uses STL internally. Now I'm using that library inside a
C++/CLI project (managed) with VC++ 2005 Beta 1. The trick is to
recompile the LIB that uses STL inside with managed settings (CLI
support turned on), even though it's not using anything managed inside.
Then make the main application project mixed-mode, because it's not
going to work when it's pure managed. It was a pain to get it to work,
but it all depends on the compiler settings. You must use the same
standard library setting for the LIB and the main app project; which I
think must be Multi-threaded DLL (/MD or /MDd). After that they will be
compatible, and the LIB can be linked to a managed project.
This should also work with DLLs, but again, you must compile a special
DLL with managed extensions turned on. You can't use a DLL compiled
without CLI support. At least not if a DLL is exporting C++ and/or STL
types; because if it's a pure C-interface DLL, it doesn't matter then.
I can help with the project settings if you have problem. There's one
more trick. My mixed-mode application crashed immediately on startup
until I added this to the Linker/Input settings:
Force Symbol References: __DllMainCRTStartup@12
(/INCLUDE:"__DllMainCRTStartup@12" linker option)
Tom