简体   繁体   中英

linker issue moving a C++ project from vs2005 to vs2010

I am attempting to convert a project from Visual Studio 2005 to 2010. (To write a plugin for Maya 2014 as it is x64 only).

To start I am compiling with VS2010 against Maya 2013 x86. This compilation and linking works fine with VS 2005 but with 2010 I get a raft of errors along the lines:

error LNK2019: unresolved external symbol "void __cdecl operator delete(void *,char const *,int)" (??3@YAXPAXPBDH@Z) referenced in function __unwindfunclet$?creator@exporter@@SAPAXXZ$0

I have attached the command line that generates the output below (some parts omitted for clarities sake). You will note the VS toolset differs from 80 to 100 (2005 vs 2010) and the block { project libs compiled with VS2005 .sln file } is missing from 2010 linker. This block is the list of dependant projects compiled by Visual Studio as part of the solution build.

Do you know how I can get these locally built libs to show up in the 2010 linker? Should I even expect them too? And can anyone suggest other points of attack to resolve this?

2005 c/c++

/Od /I "C:\\Program Files (x86)\\Autodesk\\Maya2013\\include" /I {our engine include} /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "NT_PLUGIN" /D "REQUIRE_IOSTREAM" /D "_WINDLL" /FD /EHsc /MTd /Fp {pch file output} /Fo"Debug_2013\\" /Fd"Debug_2013\\vc80.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt

2010 c/c++

/I"C:\\Program Files (x86)\\Autodesk\\Maya2013\\include" /I {our engine include} /Zi /nologo /W3 /WX- /Od /Oy- /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "NT_PLUGIN" /D "REQUIRE_IOSTREAM" /D "_WINDLL" /Gm- /EHsc /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fp*{pch file output}* /Fa"Debug\\" /Fo"Debug\\" /Fd"Debug\\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt

2005 linker

/OUT: {dll output file} /NOLOGO /LIBPATH:"C:\\Program Files (x86)\\Autodesk\\Maya2013\\lib" /DLL /MANIFEST /MANIFESTFILE: {manifest output file} /NODEFAULTLIB:"libcmt.lib" /DEBUG /PDB: {pdb file} /MAP /IMPLIB: {import library} /ERRORREPORT:PROMPT Opengl32.lib pnglib_d.lib zlib_d.lib libeay32.lib ssleay32.lib Foundation.lib OpenMaya.lib OpenMayaUI.lib OpenMayaAnim.lib OpenMayaFX.lib OpenMayaRender.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib { project libs compiled with VS2005 .sln file } /subsystem:windows /dll /incremental:yes /debug /export:initializePlugin /export:uninitializePlugin

2010 linker

/OUT: {dll output file} /NOLOGO /LIBPATH:"C:\\Program Files (x86)\\Autodesk\\Maya2013\\lib" /DLL "Opengl32.lib" "pnglib_d.lib" "zlib_d.lib" "libeay32.lib" "ssleay32.lib" "Foundation.lib" "OpenMaya.lib" "OpenMayaUI.lib" "OpenMayaAnim.lib" "OpenMayaFX.lib" "OpenMayaRender.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /NODEFAULTLIB:"libcmt.lib" /MANIFEST /ManifestFile: {manifest output file} /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB: {pdb output file} /MAP /PGD: {pgd output file} /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT /subsystem:windows /dll /debug /export:initializePlugin /export:uninitializePlugin

Finally figured out the problem!!!!

Followed the "new way" Visual Studio 2010 has project dependancies listed. http://manski.net/2011/11/project-dependencies-in-visual-c/

This solved the "unresolved symbol" issues but created this error: error MSB4006: There is a circular dependency in the target dependency graph

I solved this via the instructions here https://connect.microsoft.com/VisualStudio/feedback/details/534361/better-error-message-for-output-circular-dependency#details

Hope this saves someone a lot of trouble.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM