MFC removed from project: error LNK2001: unresolved external symbol ___argv
-
As reported in previous threads, I had to remove all use of MFC from all my projects. This is supposed to increase portability. So I replaced all CStrings, CLists, Containers, etc. It all compiles nicely now, but here is the latest problem - it won't build error LNK2001: unresolved external symbol ___argv error LNK2001: unresolved external symbol ___argc In despair I recreated all my projects under VisualStudio8 with following properties: console project Application exe Use Standard Windows Libraries Use Multi-Byte character set When I recreated the projects it made new mains which look like this: int _tmain(int ___argc, _TCHAR* ___argv[]) { // here my bits char *configfile; if ( ___argc == 2 ) { configfile = ___argv[1]; } return 0; } And it won't link. So has anyone an idea what I am doing wrong?
------------- Bibo ergo sum
-
As reported in previous threads, I had to remove all use of MFC from all my projects. This is supposed to increase portability. So I replaced all CStrings, CLists, Containers, etc. It all compiles nicely now, but here is the latest problem - it won't build error LNK2001: unresolved external symbol ___argv error LNK2001: unresolved external symbol ___argc In despair I recreated all my projects under VisualStudio8 with following properties: console project Application exe Use Standard Windows Libraries Use Multi-Byte character set When I recreated the projects it made new mains which look like this: int _tmain(int ___argc, _TCHAR* ___argv[]) { // here my bits char *configfile; if ( ___argc == 2 ) { configfile = ___argv[1]; } return 0; } And it won't link. So has anyone an idea what I am doing wrong?
------------- Bibo ergo sum
__argc and __argv are defined in the C runtime library - make sure you're linking with one of the variants of the CRT. Your problem is probably related to this Microsoft Knowledgebase article[^], although your situation doesn't match exactly.
-
__argc and __argv are defined in the C runtime library - make sure you're linking with one of the variants of the CRT. Your problem is probably related to this Microsoft Knowledgebase article[^], although your situation doesn't match exactly.