lnk 2019 Error help pls

<#include <window.h>
#include <string>
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam,LPARAM lParam) {
switch (msg) {
case WM_CHAR:
//when i add this lnk error
static std::string title;
title.push_back((char)lParam);
SetWindowText(hWnd, title.c_str());
break;
/////////
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {
const auto pClassName = "DRAMS";
WNDCLASSEX wc = { 0 };
wc.cbSize = sizeof(wc);
wc.style = CS_OWNDC;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = nullptr;
wc.hCursor = nullptr;
wc.hbrBackground = nullptr;
wc.lpszMenuName = nullptr;
wc.lpszClassName = pClassName;
wc.hIconSm = nullptr;
RegisterClassExA(&wc);

//create window Instance
HWND hWnd = CreateWindowEx(0, pClassName, "Happy Hard Window",
WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU, 200, 200, 640, 480,
nullptr, nullptr, hInstance, nullptr
);
ShowWindow(hWnd, SW_SHOW);

MSG msg;
bool gResult;
while ((gResult = GetMessage(&msg, nullptr, 0, 0) > 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (gResult == -1)
{
return -1;
}
else {
return msg.wParam;
}
}>

LNK2019 unresolved external symbol _CrtDbgReport referenced in function "void * __cdecl std::_Allocate_manually_vector_aligned<struct std:: _Default_allocate_traits > (unsigned __int64)" (?? $_Allocate_manually_vector_aligned @U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z) C:\Dev\Chilli\3ddirectx11\hw3d\WinMain.obj
Last edited on
this solve this problem
Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library
from Multi-threaded DLL to Multi-threaded Debug DLL
Topic archived. No new replies allowed.