Click here to Skip to main content
16,017,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,

Am migrating an application from VS2006 to VS2010.

Getting below error while build:

Error	10	error LNK2001: unresolved external symbol ___argv	D:\Vishal\nseexchfeeds\Nafxcwd.lib(appcore.obj)
Error	11	error LNK2001: unresolved external symbol ___argc	D:\Vishal\nseexchfeeds\Nafxcwd.lib(appcore.obj)



Help me if someone is aware of this error.

Thanks.

What I have tried:

<pre>Please check below settings which i have made in this project:

Configuration settings: 

->Use of MFC: Use MFC in a Static Library

C/C++/ -> Code Generation:

Runtime Library: Multi-threaded (/MT)

Linker:

-> Additional Dependency:

Nafxcwd.lib
msvcrt.lib
msvcrtd.lib
kslzo.lib
ex25.lib
cts.lib
wininet.lib
wsock32.lib


-> IgnoreSpecificDefaultLibraries

libc.lib
libcmt.lib
libcmtd.lib
Posted
Updated 8-Feb-18 4:02am
Comments
Vishal Bhatia0112 9-Feb-18 1:48am    
Many thanks Jochen, it works.
but i have included only libcmt.lib, ignored LIBC.lib else it was unable to call.

1 solution

Why do you ignore the default LIBC libraries?

When using the /MT option, libcmt.lib is required (resp. libcmtd.lib for debug builds). Those libraries contain the standard C library functions (and probably the global __argc and __argv variables) which are used by the startup code located in the MSVCRT library.

There is also no need to specify MSVCRT and other standard Windows libraries as additional dependancies because they are automatically linked when using functions from those libraries (which is always true for the MSVCRT).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900