Hi All,
When I try to run Interlancer Sample Code which is included in Photoshop SDK cs2 It gives Lots of error (MD5.h is giving more errors ). I think this is only of Project Settings Problem.Other Sample Codes are working fine on my System.
Does any one have any idea how to remove it? The Same error(LNK2005) Comes When I try to use MFC in my Automation Plugin.
I have included the afx.h and afxwin.h at the top of every file
Also I have included stdfx.h
After that I am including the Photoshop's File. I am using Visual studio 2003 and 2005
I have tried the solution given on the Microsoft site. but of No help.
Below are the errors:
error LNK2005: _DllMain@12 already defined in PIDLLInstance.obj nafxcwd.lib
error LNK2005:''void * __cdecl operator new(unsigned int)'' (??2@YAPAXI@Z) already defined in PIUNew.obj nafxcwd.lib
error LNK2005:''void __cdecl operator delete(void *)'' (??3@YAXPAX@Z) already defined in PIUNew.obj nafxcwd.lib
error LNK2005: ''void * __cdecl operator new[](unsigned int)'' (??_U@YAPAXI@Z) already defined in PIUNew.obj nafxcwd.lib
error LNK2005: ''void __cdecl operator delete[](void *)'' (??_V@YAXPAX@Z) already defined in PIUNew.obj nafxcwd.lib
MD5.h--------------------------------------------------------------------
error C2061: syntax error : identifier 'istream'
error C2061: syntax error : identifier 'ifstream'
error C2535: 'void MD5::update(void)' : member function already defined or declared
see declaration of 'MD5::update'
error C2143: syntax error : missing ')' before '%26amp;'
error C2143: syntax error : missing ';' before '%26amp;'
error C2460: 'MD5::istream' : uses 'MD5', which is being defined
d:\Program Files\Adobe Photoshop CS2 SDK\samplecode\automation\Interlancer\win\md5.h(7) : see declaration of 'MD5'
error C2059: syntax error : ')'
error C2501: 'MD5::stream' : missing storage-class or type specifiers
error C2143: syntax error : missing ')' before '%26amp;'
error C2143: syntax error : missing ';' before '%26amp;'
error C2059: syntax error : ')'
Interlancer Sample Code Not Working
Hi Sunil,
its a bit difficult to do a remote analysis without the code or project settings, but the part about including the stdfx and afx/afxwin headers sounds a bit confusing. Do you include ''stdfx.h'' or ''stdafx.h'' and what is inside (gets included by) your stdfx.h? Usually you include the stdafx.h in every file of your project, wich then includes the afx.h and the afxwin.h. Maybe you're allready including them indirectly in the stdfx.h and then once again by the include statements?
Interlancer Sample Code Not Working
Hi Marc,
I am so sorry about the typo error. Actually I have included stdafx.h and inside that afxwin.h is included.
and I include afx.h in every file at the top of it.
When I remove the afx.h and afxwin.h from the project then also it is giving the same error and same no. of errors.
error----------------------------------------------------------------
error LNK2005: _DllMain@12 already defined in PIDLLInstance.obj nafxcwd.lib
error LNK2005:''void * __cdecl operator new(unsigned int)'' (??2@YAPAXI@Z) already defined in PIUNew.obj nafxcwd.lib
error LNK2005:''void __cdecl operator delete(void *)'' (??3@YAXPAX@Z) already defined in PIUNew.obj nafxcwd.lib
error LNK2005: ''void * __cdecl operator new[](unsigned int)'' (??_U@YAPAXI@Z) already defined in PIUNew.obj nafxcwd.lib
error LNK2005: ''void __cdecl operator delete[](void *)'' (??_V@YAXPAX@Z) already defined in PIUNew.obj nafxcwd.lib
---------------------------------------------------------------------
PS* The above error is coming in my automation plugin.
---------------------------------------------------------------------
I have not changes anything in the samplecode of ''Interlancer'' Project. So, it is as it was provided during the download of CS2 SDK.But here the error which are coming is most of syntax error.
Other Sample codes are working fine on my sysytem. So I was thinking that there must be some extra project settings for this interlancer project.
Thanks and Regards,
Sunil Kumar
Hi Sunil,
didn't no what I thought when I first answered, it couldn't be the afx.h inlcudes because they also have a #ifndef #define block - that was a stupid suggestion. I'll try to help you tomorrow, today I don't even have access to VS.
Hi Sunil,
which solution from Microsoft are you refering to, is it this one:
http://support.microsoft.com/kb/148652/en?
Also, instead of statically linking the MFC try to link it dynamic (or the other way around, depending on what is set in your project settings). Also try to change the use of precompiled headers to ''not using precompiled headers'' (you have to clean and then rebuild all afterwards).
Otherwise I found those two suggestions in a forum:
''What you might want to try and do is go into the project settings and goto the C/C++ tag and then goto the Code Generation Category. There you will find the Use run-time library. You will want to make sure that all you librarys are either all single-threaded or multi-threaded. Have a play around with these settings. That might do the trick.''
Make sure that (this is probably allready the case in your project):
- the stdafx.h is only included in your *.cpp files
- include stdafx.h then standard c headers then your own headers
Good luck!
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment