Hi all,
I am testing with a new QT5.5 project x86 under VS2015.
Here is my little program:
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QByteArray>
1 int main(int argc, char *argv[]){
4
5 std::string str=message.toStdString().c_str();
7
8 qDebug()<<str.c_str();
9
10 return a.exec();
11 }
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QByteArray>
1 int main(int argc, char *argv[]){
2 QCoreApplication a(argc, argv);
3 QString message="1234567890";
4
5 std::string str=message.toStdString().c_str();
6 QByteArray a1=message.toUtf8();
7
8 qDebug()<<str.c_str();
9
10 return a.exec();
11 }
To copy to clipboard, switch view to plain text mode
The troubles:
1) After building I get error LNK2019: unresolved external symbol for QString::toUtf8() in 6);
2) If I delete the line 6) and run the program I get:
1) An assertion into minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp in Debug mode;
2) no 'apparent' problem in release mode.
No problems under the QT Creator.
What I can search for?
Cheers,
Giorgio
Added after 21 minutes:
I seen that setting 'Visual Studio 2013 (v120)' in project property page --> Configuration Properties --> Platform toolset
the assertion does not happen and also the LNK2019 is solved.
Can some one explain me in details the motive, please?
Cheers.
Giorgio
Cheers,
Giorgio
Bookmarks