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. __pctype & ___mb_cur_max

__pctype & ___mb_cur_max

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++toolsquestionannouncement
3 Posts 3 Posters 4 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.
  • A Offline
    A Offline
    Andrew Hoole
    wrote on last edited by
    #1

    Hi I hope I am not asking a real dumb question but this problem has got me beat. I am compiling my MFC developed application and linking it with someother libraries that I have got from somewhere and compiled myself. When I do this I get the following linking errors ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol __pctype ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol __pctype ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol ___mb_cur_max ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol ___mb_cur_max Release/LMWS.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. Before getting to this stage I had some errors about duplicate definition of stuff in libcmt.lib and msvcrt.lib so I have told the system to ignore libcmt.lib Now I have looked on the web and seen that the offending symbols are declared in ctype.h. Now my questions are - obviously now can I sort this out - but also in the error message I am getting the symbols have two '_' and three '_' characters respectively but in the ctype.h file they only have one and two respectively. Is this second question of any relevence or am I just not understanding how the compiler puts it altogether. Many thanks for any help. Andrew

    J S 2 Replies Last reply
    0
    • A Andrew Hoole

      Hi I hope I am not asking a real dumb question but this problem has got me beat. I am compiling my MFC developed application and linking it with someother libraries that I have got from somewhere and compiled myself. When I do this I get the following linking errors ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol __pctype ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol __pctype ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol ___mb_cur_max ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol ___mb_cur_max Release/LMWS.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. Before getting to this stage I had some errors about duplicate definition of stuff in libcmt.lib and msvcrt.lib so I have told the system to ignore libcmt.lib Now I have looked on the web and seen that the offending symbols are declared in ctype.h. Now my questions are - obviously now can I sort this out - but also in the error message I am getting the symbols have two '_' and three '_' characters respectively but in the ctype.h file they only have one and two respectively. Is this second question of any relevence or am I just not understanding how the compiler puts it altogether. Many thanks for any help. Andrew

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      With respect to your second question, I guess the extra underscores are not important --it is some sort of name encoding performed by the compiler prior to letting the linker act. If you want to see this in full action, try declaring and using some undefined member function on a class of your own: when the linker fails to find the definition you'll see the name has been adorned with all kinds of funny characters. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      • A Andrew Hoole

        Hi I hope I am not asking a real dumb question but this problem has got me beat. I am compiling my MFC developed application and linking it with someother libraries that I have got from somewhere and compiled myself. When I do this I get the following linking errors ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol __pctype ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol __pctype ctn_lib.lib(dcm.obj) : error LNK2001: unresolved external symbol ___mb_cur_max ctn_lib.lib(utility.obj) : error LNK2001: unresolved external symbol ___mb_cur_max Release/LMWS.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. Before getting to this stage I had some errors about duplicate definition of stuff in libcmt.lib and msvcrt.lib so I have told the system to ignore libcmt.lib Now I have looked on the web and seen that the offending symbols are declared in ctype.h. Now my questions are - obviously now can I sort this out - but also in the error message I am getting the symbols have two '_' and three '_' characters respectively but in the ctype.h file they only have one and two respectively. Is this second question of any relevence or am I just not understanding how the compiler puts it altogether. Many thanks for any help. Andrew

        S Offline
        S Offline
        Sardaukar
        wrote on last edited by
        #3

        If all this is in V6... I don't know settings in V7, then: Probably you have checked in project settings "Ignore default libraries". Try to add in libraries section libcd.lib (for debug builds) or libc.lib (release). The best way to detect such missing link symbols - at least for me - is to copy the offending symbol name, modify project settings to: - uncheck "Ignore default libraries" - check in Link --> Customize --> Print Progress messages and rebuild all. The linked with produce a verbose output wher you can search for the symbol. Usually, it will look like this: [Unsuccesful build] xxxxxxxx.obj : error LNK2001: unresolved external symbol _yyyyyyy [Rebuild with ignore default lib. off] Searching \.lib: Found __yyyyyyy Referenced in xxxxxxxx.obj Loaded DDDDDDDD.lib(DDDDDDDD.dll) Now you see that the missing lib is DDDDDDDD.lib; put back your project settings, add the new lib to Link section and rebuild. Usual trap libraries: - CRT: libc.lib (C), libcp.lib (C++), libcmt.lib (C multithread), libcpmt.lib (C++ MT) - msvcrt.lib (add a 'd' for debug builds, so Release uses libc.lib, Debug uses libcd.lib etc.) - COM support classes (_com_error) in comsupp.lib - Common dialogs in commdlg32.lib - shell API (shlwapi.lib) just to point some of (my :) ) usual mistakes.

        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