Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Unable to build VS2010 project with CyApi.lib

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Unable to build VS2010 project with CyApi.lib
Moderator:
RSKV

Post Reply
Follow this topic



Unable to build VS2010 project with CyApi.lib

JAB posted on 16 Jun 2011 6:28 AM PST
Member
2 Forum Posts

 Hi,

We are in the process of upgrading from Visual Studio 2008 to Visual Studio 2010. I rebuilt all projects in VS2010 and the only one that failed is the one that links to CyApi.lib. Here are the errors I am getting:

13>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\Users\John\Development\trunk\USB\.\Debug\USB.dll) does not match the Linker's OutputFile property value (C:\Users\John\Development\trunk\Bin\USBD.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

13>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(USB) does not match the Linker's OutputFile property value (USBD). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

13>LIBCMT.lib(sprintf.obj) : error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(printf.obj) : error LNK2005: _printf already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(atox.obj) : error LNK2005: _atoi already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in msvcrtd.lib(MSVCR100D.dll)

13>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)

13>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)

13>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)

13>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)

13>     Creating library ../Bin/USBD.lib and object ../Bin/USBD.exp

13>LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library

13>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

13>LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

13>../Bin/USBD.dll : fatal error LNK1120: 1 unresolved externals

 

Has anyone seen this before? If so, what can I do to get this to build?

Thanks!

JAB

 




Re: Unable to build VS2010 project with CyApi.lib

aasi posted on 16 Jun 2011 06:46 AM PST
Cypress Employee
1090 Forum Posts

The CyAPI.lib currently available through the site was compiled with VS2008. Usually backward compatibility is maintained so I'm little confused about why VS2010 is not able to compile.

One thing that strikes me is that if the issue is due to CyAPI.lib then there would have been a few error statement with CyAPI.lib in them which is not the case here. Have you tried tweaking the project properties based on Microsoft KBs?? for eg: http://support.microsoft.com/kb/148652

Regards,

Anand



Re: Unable to build VS2010 project with CyApi.lib

JAB posted on 16 Jun 2011 07:12 AM PST
Member
2 Forum Posts

 Thanks for your reply.

I had already looked at the kb article you referenced, but since you mentioned it, I took a closer look. I checked my code to make sure I am doing what was suggested in the article. The code was already organized correctly.

I have solved the problem! My project settings had several libraries specified to ignore. Just for grins, I removed them all from the settings and built again. Still errors. Then I added one of them back in (libcmt.lib) and rebuilt. Success!

/NODEFAULTLIB:libcmt.lib

JAB

 

 



Re: Unable to build VS2010 project with CyApi.lib

gopv posted on 08 Nov 2011 02:32 AM PST
Cypress Employee
20 Forum Posts

The latest suiteusb version (3.4.6) support VS2010 (http://www.cypress.com/?rID=34870)






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20