0
votes

I am using cpprest with Qt Creator 4.2.1 Based on Qt 5.8.0 (MSVC 2015, 32 bit).

I have modified the .pro file to indicate

INCLUDEPATH += C:/cpprest/Release/include

i am getting the following error :

mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_string,class std::allocator > __cdecl utility::conversions::to_string_t(class std::basic_string,class std::allocator > const &)" (__imp_?to_string_t@conversions@utility@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z) referenced in function "class web::uri __cdecl generateOMDBQuery(class std::basic_string,class std::allocator > const &)" (?generateOMDBQuery@@YA?AVuri@web@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

as per this answer i need to set

Treat wchar_t was Built-in Type to No in C/C++ -> Language.

Till where i understand this is setting for Visual Studios. How can i set this in QT creator?

1
No import library used for this project is maybe the reason.Alexander V

1 Answers

0
votes

I agree with "AlexanderVX" comment going with command line build.

This is to address your question, I mean setting the option -- "Treat wchar_t was Built-in Type to No in C/C++ -> Language."

This setting I am not sure with "QtCreator".

But you can set it in your QMake, if you go for command line build.

For windows build (MSDN documentation):

/Zc:wchar_t is for treating "WChar_t As Built in type".

/Zc:wchar_t- is for not treating "WChar_t As Built in type".

These settings can be done in respective QMake file for windows operating system.

You can find the file usually in "mkspecs\win32-msvc2010" (version numbers may vary)

for Qt4.8 i see them in,

Qt_4.8.0\4.8.0_original\mkspecs\win32-msvc2010 

Open the make file in a note pad, and find for "QMAKE_CFLAGS", and add "-Zc:wchar_t-" option, as shown below. Be watchful of negative sign

QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-