STA, MTA conflict warning
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: STA, MTA conflict warning

Hybrid View

  1. #1
    Join Date
    Oct 2010

    STA, MTA conflict warning

    Hello everyone,

    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
    #include <afxmt.h>
    #include "Winsock2.h."
    #include <time.h>

    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 that helped me get started on all this.

  2. #2
    Join Date
    Oct 2010

    Re: STA, MTA conflict warning

    Anybody Home?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)