cl.exe default libraries

Hey folks

I'm trying to write a managed wrapper for breakpad to use it in .NET.
As I'm new to c++ I did not want to fight with visual studio and have set up my project in an text editor. I'm calling cl.exe direct. Now I have linked all dependencies but I still have some problems. I have the suspicion that I'm missing a default library but honestly I've no idea.. Does anybody know more about this then me?


BreakpadWrapper.cpp
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >(struct std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::_Has_debug_it)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@U_Has_debug_it@01@@Z)
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > & __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::operator=(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@ABV01@@Z)
exception_handler.obj : error LNK2001: unresolved external symbol __imp____iob_func
exception_handler.obj : error LNK2001: unresolved external symbol __imp___invalid_parameter
exception_handler.obj : error LNK2001: unresolved external symbol __imp___snwprintf_s
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (__imp_??1_Container_base_secure@std@@QAE@XZ)
exception_handler.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ)
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Throw(class stdext::exception const &)" (__imp_?_Throw@std@@YAXABVexception@stdext@@@Z)
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
exception_handler.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ)
BreakpadWrapper.dll : fatal error LNK1120: 11 unresolved externals


cl /GF /GT /GR /Od /LD /clr /MD /Gy /WX- /Zc:wchar_t /Zc:forScope /Zc:inline /fp:precise BreakpadWrapper.cpp kernel32.lib user32.lib advapi32.lib msvcrt.lib wininet.lib exception_handler.lib exception_handler.obj common.lib guid_string.obj http_upload.obj string_utils.obj crash_report_sender.lib crash_report_sender.obj crash_generation_client.lib crash_generation_client.obj /link /LTCG

All compiler options
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cl /Zi /nologo /GF /GT /GR /Od /LD /clr /MD /Gy 
/WX- /W4 /wd"4100" /wd"4127" /wd"4396" /wd"4503" /wd"4512" /wd"4819" /wd"4995" /wd"4702" /wd"4800" 
/Zc:wchar_t /Zc:forScope /Zc:inline /fp:precise 
/D "_WIN32_WINNT=0x0600" /D "WINVER=0x0600" /D "WIN32" /D "_WINDOWS" /D "_HAS_EXCEPTIONS=0" /D "NOMINMAX" /D "_CRT_RAND_S" /D "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS" /D "WIN32_LEAN_AND_MEAN" /D "_SECURE_ATL" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_WARNINGS" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_USING_V110_SDK71_" /D "NDEBUG" /D "NVALGRIND" /D "OFFICIAL_BUILD" /D "_UNICODE" /D "UNICODE" 
BreakpadWrapper.cpp kernel32.lib user32.lib advapi32.lib msvcrt.lib wininet.lib 
client\windows\handler\exception_handler.lib 
client\windows\handler\exception_handler.obj 
client\windows\Release\lib\common.lib 
client\windows\Release\obj\common\guid_string.obj 
client\windows\Release\obj\common\http_upload.obj 
client\windows\Release\obj\common\string_utils.obj 
client\windows\sender\Release\lib\crash_report_sender.lib 
client\windows\sender\Release\obj\crash_report_sender\crash_report_sender.obj 
client\windows\crash_generation\Release\lib\crash_generation_client.lib 
client\windows\crash_generation\Release\obj\crash_generation_client\crash_generation_client.obj 
/I"C:\Projects\Omaha\third_party\breakpad\src" 
/I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include" 
/I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" 
/I"C:\Projects\C++Test\ManagedBreakpadWrapper" 
/I"c:\Program Files (x86)\Windows Kits\8.1\Include\shared" 
/I"c:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
/link /LTCG
Last edited on
Hi,
Can you let us see your code?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "client/windows/handler/exception_handler.h"
#using <System.dll>

using namespace System;
using namespace google_breakpad;

namespace BreakpadWrapper {
  public ref class ManagedExceptionHandler {
  protected:
    ExceptionHandler * exceptionHandler;
  public:
    ManagedExceptionHandler() {
      exceptionHandler = new ExceptionHandler(
				L"dumps\\",
				*new google_breakpad::ExceptionHandler::FilterCallback(),
				*new google_breakpad::ExceptionHandler::MinidumpCallback(),
				0,
				google_breakpad::ExceptionHandler::HANDLER_ALL,
				MiniDumpNormal,
				L"",
				0);
    }
    ~ManagedExceptionHandler() {
      delete exceptionHandler;
    }

    bool WriteMinidump() {
      return exceptionHandler->WriteMinidump();
    }

    /*
    more wrapping functions from google_breakpad::ExceptionHandler
    */

  };
}


The source for breakpad can be found here: https://github.com/google/breakpad
Last edited on
What C++ complier are you using?
cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23918 for x86

From visual studio 2015
Last edited on
I did a rebuild of breakpad and linked the libraries again. I think I just mixed up debug and release libraries.. everything is working now
Topic archived. No new replies allowed.