Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC removed from project: error LNK2001: unresolved external symbol ___argv

MFC removed from project: error LNK2001: unresolved external symbol ___argv

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RedSonja
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • R RedSonja

      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

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      __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.

      R 1 Reply Last reply
      0
      • S Stuart Dootson

        __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.

        R Offline
        R Offline
        RedSonja
        wrote on last edited by
        #3

        That was it! I had to change the C run-time library from debug multithreaded DLL to debug multithreaded.

        ------------- Bibo ergo sum

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups