Annoying Linker Errors occurs when linking the libhpdf.lib and including the proper header files.

I’m using the Haru free PDF library to create PDF’s programmatically but when I downloaded the static libraries and linked them to my program and compiled the program I get a bunch of linker errors. Which I don’t know why it gives me those errors. Here are
the errors below:

Warning    20    warning LNK4098: defaultlib ‘MSVCRTD’ conflicts with use of other libs; use /NODEFAULTLIB:library    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF 
The Free PDF EditorLINK

Warning    21    warning LNK4098: defaultlib ‘libcmt.lib’ conflicts with use of other libs; use /NODEFAULTLIB:library    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF 
The Free PDF EditorMSVCRTD.lib(cinitexe.obj)

Warning    1    warning C4700: uninitialized local variable ‘error’ used    c:usersdannydocumentsvisual studio 2010projectsd-pdf  the free pdf editord-pdf  the free pdf editord-pdf  the free
pdf editor.cpp    158    1

Error    25    error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free
PDF Editorlibcmt.lib(crt0.obj)

Error    24    error LNK2019: unresolved external symbol _deflateInit_ referenced in function _HPDF_Stream_WriteToStreamWithDeflate    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF
EditorD-PDF  The Free PDF Editorlibhpdf.lib(hpdf_streams.obj)

Error    22    error LNK2019: unresolved external symbol _deflateEnd referenced in function _HPDF_Stream_WriteToStreamWithDeflate    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF 
The Free PDF Editorlibhpdf.lib(hpdf_streams.obj)

Error    23    error LNK2019: unresolved external symbol _deflate referenced in function _HPDF_Stream_WriteToStreamWithDeflate    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF 
The Free PDF Editorlibhpdf.lib(hpdf_streams.obj)

Error    6    error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0dat.obj)

Error    12    error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(winxfltr.obj)

Error    10    error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(mlock.obj)

Error    11    error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(mlock.obj)

Error    3    error LNK2005: __ldused already defined in a previous module    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(_fpinit_.obj)

Error    4    error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(invarg.obj)

Error    5    error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0dat.obj)

Error    2    error LNK2005: __fltused already defined in a previous module    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(_fpinit_.obj)

Error    7    error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0dat.obj)

Error    19    error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(setlocal.obj)

Error    8    error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0dat.obj)

Error    9    error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0dat.obj)

Error    15    error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0init.obj)

Error    14    error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0init.obj)

Error    17    error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0init.obj)

Error    16    error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(crt0init.obj)

Error    18    error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(errmode.obj)

Error    13    error LNK2005: “void __cdecl terminate(void)” ([email protected]@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll)    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free
PDF EditorD-PDF  The Free PDF Editorlibcmt.lib(hooks.obj)

Error    26    error LNK1120: 4 unresolved externals    C:UsersDannyDocumentsVisual Studio 2010ProjectsD-PDF  The Free PDF EditorDebugD-PDF  The Free PDF Editor.exe

Hi,You are using different runtime library  with the PDF library. Try to use Multi-Threaded(Debug).RenJie

You could try forums of library  providers. I assume they could give you the correct answers much easier, since I doubt you are first one to try to use library in VS. I also assume they provide some examples of usage. Other than that most are common warnings and errors. For starters try clicking on error/warning line in output window and click F1. You will get some explanations and possible solutions. Try researching MSDN forums for individual errors  for other libraries

How do you multi-threading debugging?