Reputation: 1415
in visual studio 2010 express edition. i have a project (a static library) called prj1. prj1 has codes to create an object obj1.
in another project prj2 which is a dynamic library i have code which intantiates the object by "new obj1" (the code of obj1 is in prj1).
now when i try to build prj2 i get linking errors:
1> when i try to right click on prj2->properties->frameworkk and references if i add prj1 as new reference i get a lot of link errors like MSVCRTD.lib(MSVCR100D.dll) : error LNK2005:
2> if i do not do step1 above and right click on the solution->properties->project dependencies and then choose prj1 to depend on the prj2. then i get just get a link error which complains that : error LNK2019: unresolved external symbol obj1... unresolved externals.
It would be very kind if someone can help me resolve this issue.
Thanks
Upvotes: 0
Views: 186
Reputation: 10979
Seems that your options that choose runtime library differ. One project for example links to "multi-threaded debug DLL" and other project to "multi threaded debug". When you try to link the projects to each other then you get multiply defined runtime library symbols.
Upvotes: 1
Reputation: 3486
Your static library must be found/added to your library directories, and dependency list, too.
Upvotes: 0