January 11th, 2011, 01:12 PM
STA, MTA conflict warning
I recently started writing a C++/CLI wrapper for a native c++ library. I'm now getting this compile warning
"warning LNK4249: directive '/CLRTHREADATTRIBUTE:STA' conflicts with command line; ignored"
My c++/cli wrapper is set up for MTA in the linker's command line arguments, but I have no idea what file or project is trying to give the STA directive.
I did enough reading to get worried about .NET forcing libraries to become multi-threaded. I've read that this mostly affects my application's use of COM, but I am not really sure if or where my DLL uses COM. I use the interop services to marshal string data and am using 'msclr\auto_gcroot.h' to point to managed classes from unmanaged ones. In the native c++ library that is being wrapped, I include the following headers:
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
Does anybody have any advice that could help me avoid painful experiences in the future, or should I just not worry about it?
By the way, thanks Andreas Wieberneit for posting the article http://www.codeguru.com/cpp/cpp/cpp_...icle.php/c6867 that helped me get started on all this.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!