web::http::uri broken in v1.4 for Debug/32?

Feb 19, 2014 at 3:30 AM
I'm getting different results between Debug/32 and Release/32 for the following code with C++ Rest 1.4 using VS 2013. The code works in Release but in debug, inspecting uri contains bogus contents. Is Debug/32 dll broken? I doubled checked and it seems like the file is correct for VS 2013 debug 32.
#include "stdafx.h"
#include "cpprest\http_listener.h"

int _tmain(int argc, _TCHAR* argv[])
    web::http::uri uri(L"http://localhost");
    std::wcout << uri.to_string();
Release correctly shows m_uri containing http://localhost but Debug has the following invalid result.

(<Error reading characters of string.>)
m_uri: <Error reading characters of string.>
m_components: {m_scheme=<Error reading characters of string.> m_host=<Error reading characters of string.> m_user_info=...}
Feb 19, 2014 at 3:43 PM
I've found the problem. Project's Debug linker's Lib properties was specifying cpprest120_1_4.lib instead of cpprest120d_1_4.lib and thus not matching cpprest120d_1_4.dll. My bad. However, this issue likely can be absolutely avoided in the future. I'm thinking there should be some mechanism whereby the project will fail to link if Debug/Release or 32/64 libs (which are named the same) are confused. I'll post this as a suggestion in Issues.
Marked as answer by BSalita on 2/19/2014 at 7:43 AM