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. error LNK2019: unresolved external symbol

error LNK2019: unresolved external symbol

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
13 Posts 4 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.
  • P Purish Dwivedi

    this function is defined in a file named ExceptionHandler.cpp . I am not getting that what to do to remove this linker error? Plz provide any solution if possible. Thank You.

    _ Offline
    _ Offline
    _AnsHUMAN_
    wrote on last edited by
    #4

    are you sure this function is defined and declared and you have included the header file for this class.

    You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

    P 1 Reply Last reply
    0
    • _ _AnsHUMAN_

      are you sure this function is defined and declared and you have included the header file for this class.

      You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      P Offline
      P Offline
      Purish Dwivedi
      wrote on last edited by
      #5

      yes, I have included.

      1 Reply Last reply
      0
      • P Purish Dwivedi

        this function is defined in a file named ExceptionHandler.cpp . I am not getting that what to do to remove this linker error? Plz provide any solution if possible. Thank You.

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #6

        Did you add this ExceptionHandler.cpp file to your project ?

        Cédric Moonen Software developer
        Charting control [v2.0] OpenGL game tutorial in C++

        P 1 Reply Last reply
        0
        • C Cedric Moonen

          Did you add this ExceptionHandler.cpp file to your project ?

          Cédric Moonen Software developer
          Charting control [v2.0] OpenGL game tutorial in C++

          P Offline
          P Offline
          Purish Dwivedi
          wrote on last edited by
          #7

          Obviously,It is added in my project. Now, I am not getting that how to remove this error? plz help me. Thanks.

          C 1 Reply Last reply
          0
          • P Purish Dwivedi

            Obviously,It is added in my project. Now, I am not getting that how to remove this error? plz help me. Thanks.

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #8

            Purish Dwivedi wrote:

            Obviously,It is added in my project.

            Why obviously ? Seing your error and the fact that you are sure that you have a body for your function, then I would say that it is obvious that the file is not added to your project. I am talking here about the cpp file, not the h file. How did you add this file to your project ? Can you also post the function prototye (which is in the header file) and the function body (which is in the cpp file) ? Please use the code tag to format the code properly when posting.

            Cédric Moonen Software developer
            Charting control [v2.0] OpenGL game tutorial in C++

            P 1 Reply Last reply
            0
            • P Purish Dwivedi

              I am getting an error like ExceptionAttacher.obj : error LNK2019: unresolved external symbol "int __cdecl RecordExceptionInfo(struct _EXCEPTION_POINTERS *,char const *)" (?RecordExceptionInfo@@YAHPAU_EXCEPTION_POINTERS@@PBD@Z) referenced in function "int __stdcall AfxWinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,wchar_t *,int)" (?AfxWinMain@@YGHPAUHINSTANCE__@@0PA_WH@Z) What should I do to remove this linker error? Plz help me. Thanks

              S Offline
              S Offline
              Stephen Hewitt
              wrote on last edited by
              #9

              The error message seems to be saying:  A function with the signature int __cdecl RecordExceptionInfo(struct _EXCEPTION_POINTERS *,char const *) is referenced in the file "ExceptionAttacher.???" from the function int __stdcall AfxWinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,wchar_t *,int). Clearly the function int __cdecl RecordExceptionInfo(struct _EXCEPTION_POINTERS *,char const *) is declared or we would have a compiler error instead, but it's not defined or the file it's defined in is not included in the project because the linker can't find it.   PS: Why the function AfxWinMain defined in "ExceptionAttacher.xxx"? This function is part of the MFC framework and not meant to be user defined.

              Steve

              1 Reply Last reply
              0
              • C Cedric Moonen

                Purish Dwivedi wrote:

                Obviously,It is added in my project.

                Why obviously ? Seing your error and the fact that you are sure that you have a body for your function, then I would say that it is obvious that the file is not added to your project. I am talking here about the cpp file, not the h file. How did you add this file to your project ? Can you also post the function prototye (which is in the header file) and the function body (which is in the cpp file) ? Please use the code tag to format the code properly when posting.

                Cédric Moonen Software developer
                Charting control [v2.0] OpenGL game tutorial in C++

                P Offline
                P Offline
                Purish Dwivedi
                wrote on last edited by
                #10

                [Message Deleted]

                S C 2 Replies Last reply
                0
                • P Purish Dwivedi

                  [Message Deleted]

                  S Offline
                  S Offline
                  Stephen Hewitt
                  wrote on last edited by
                  #11

                  Purish Dwivedi wrote:

                  Prototype is as: int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message);

                  Purish Dwivedi wrote:

                  Function definition is as:   int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS pExceptPtrs, LPCTSTR lpszMessage)

                  The underlined bits have been added. Note that if you're building for Unicode then the first is an ANSI string and the second is Unicode and so the second in NOT the definition of the first.

                  Steve

                  1 Reply Last reply
                  0
                  • P Purish Dwivedi

                    [Message Deleted]

                    C Offline
                    C Offline
                    Cedric Moonen
                    wrote on last edited by
                    #12

                    The arguments of the function prototype do not match the arguments of the function definition if UNICODE is defined (in which case, LPCTSTR will resolve to a wchar string, and not a char string). So, replace the char in the function prototype by the same LPCTSTR and this should fix your problem.

                    Cédric Moonen Software developer
                    Charting control [v2.0] OpenGL game tutorial in C++

                    P 1 Reply Last reply
                    0
                    • C Cedric Moonen

                      The arguments of the function prototype do not match the arguments of the function definition if UNICODE is defined (in which case, LPCTSTR will resolve to a wchar string, and not a char string). So, replace the char in the function prototype by the same LPCTSTR and this should fix your problem.

                      Cédric Moonen Software developer
                      Charting control [v2.0] OpenGL game tutorial in C++

                      P Offline
                      P Offline
                      Purish Dwivedi
                      wrote on last edited by
                      #13

                      thanks, I have removed this error.

                      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