Reputation: 12832
I have a WinRT application for Windows 8 that contains several C++ static libraries and one WinRT native static C++ library. It's not linking because it's complaining of multiply defined symbols related to the threading model libraries:
vccorlibd.lib(tmmta.obj) : error LNK2005: "int __abi___threading_model" (?__abi___threading_model@@3HA) already defined in vccorlibd.lib(tmdefault.obj)
fatal error LNK1169: one or more multiply defined symbols found
Note that it's trying to link with the MTA threading model lib (tmmta) with the default treading model lib (tmdefault).
I can't find any setting in the project properties to change this. Closest I've found is the CLR Thread Attribute but changing this setting has no effect. I don't know which sub-project in my solution is using which threading model.
How and where can I see and change the threading model setting?
Thanks!
Upvotes: 2
Views: 1439
Reputation: 66
Here is the answer about your question. I had the same problem :)
Edited:
Probably this is caused because you have main()
function or/and you define [Platform::MTAThread]
( witch create MTA symbol ) in your WinRT static library. Now the executable code don't know how should be initialized because executable dont know anything about your declaration.
You can move that main()
function to your executable project or ( witch in my case works ) be sure that you #include header to object where you declare your main function, then linker could see it and would not duplicate symbol.
Upvotes: 5