error LNK2019: unresolved external symbol
-
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.
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_
-
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_
yes, I have included.
-
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.
Did you add this ExceptionHandler.cpp file to your project ?
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++ -
Did you add this ExceptionHandler.cpp file to your project ?
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++Obviously,It is added in my project. Now, I am not getting that how to remove this error? plz help me. Thanks.
-
Obviously,It is added in my project. Now, I am not getting that how to remove this error? plz help me. Thanks.
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++ -
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
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 functionint __stdcall AfxWinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,wchar_t *,int)
. Clearly the functionint __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 functionAfxWinMain
defined in "ExceptionAttacher.xxx"? This function is part of the MFC framework and not meant to be user defined.Steve
-
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++[Message Deleted]
-
[Message Deleted]
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
-
[Message Deleted]
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++ -
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++thanks, I have removed this error.