Qt code c000001d in virtual machine - c++

i created a project in Visual Studio 2013 with Qt. I added Qt to VS2013 with the add-in and started to design a mainwindow in the Qt Creator.
My code looks like this :
main.cpp :
#include "test2.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
test2 w;
w.show();
return a.exec();
}
test2.h :
#ifndef TEST2_H
#define TEST2_H
#include <QtWidgets/QMainWindow>
#include "ui_test2.h"
class test2 : public QMainWindow
{
Q_OBJECT
public:
test2(QWidget *parent = 0);
~test2();
private:
Ui::test2Class ui;
};
#endif // TEST2_H
test2.cpp :
#include "test2.h"
test2::test2(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
}
test2::~test2()
{
}
After this I built the solution and moved it to a virtual machine.
Visual Studio : 64 bit Release Version
Qt : Qt 5.3.2 for Windows 64-bit (VS 2013, OpenGL, 573 MB)
Virtual machine : 64 bit.
Installed the Visual C++ Redistributable für Visual Studio 2013 on the virtual machine.
The VmWarePlayer is used for the virtual machine.
On another normal 64bit computer everything works fine.
Problem signature:
Problem Event Name: APPCRASH
Application Name: test2.exe
Application Version: 0.0.0.0
Application Timestamp: 5434e66b
Fault Module Name: MSVCR120.dll
Fault Module Version: 12.0.21005.1
Fault Module Timestamp: 524f83ff
Exception Code: c000001d
Exception Offset: 0000000000095c01
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 1031
Additional Information 1: 6abf
Additional Information 2: 6abf78853a12e8504a5f26d8c231927b
Additional Information 3: 1f6d
Additional Information 4: 1f6d0c3c3ab43abf0b4e81f905afc8ea
My directory looks like this :

I might have found the answer for my issue, to me it helped to install all updates for the virtual machine, after this my program was running without any problems.

Some VMs have incorrect advanced instructions support. For example: native c++ application build in MSVC++ 2012/2013 x64 toolset with Advanced Vector Extensions (/arch:AVX) will CRASHED on VirtualBox with exception C000001d (invalid instruction code).
You should set project property Enable Enhanced Instruction Set to "Not Set". Only such x64 project configuration will work on all VMs.

Related

How to configure Eclipse for Gtkmm (with C++)

I have set up Eclipse (on Ubuntu 20.04) for C/C++ programming and are attempting to configure the IDE for Gtkmm.
I have installed the Pkg-config support for Eclipse for CDT 1.0.0 plug-in.
Then I have created a new C++ project and checked the Gtkmm-3.0 box in
Properties
—C/C++ build
—Settings
— Pkg-config
Then I try to compile the following program:
#include <gtkmm.h>
class MyWindow : public Gtk::Window
{
public:
MyWindow();
};
MyWindow::MyWindow()
{
set_title("Basic application");
set_default_size(200, 200);
}
int main(int argc, char* argv[])
{
auto app = Gtk::Application::create("org.gtkmm.examples.base");
return app->make_window_and_run<MyWindow>(argc, argv);
}
But I get the following error:
Fatal error: Gtkmm.h : Cannot find file or folder
How do I configure the IDE or project to get it to compile?
Regards
Jarl

How to step into Qt source code in QT Creator with Qt 5.14 MSVC2017?

I want to step into Qt source code to see how some of its functions work. But I can't step into the Qt source code.
What I've tried:
Tools - Options - Debugger - General - Add Qt sources... - select Qt source folder (D:\Qt\Qt5.14.1\5.14.1\Src, which is installed along with installation of Qt 5.14.1)
Tools - Options - Debugger - CDB Paths - Insert Symbol Server... - click OK with default value.
new project with code:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel l;
l.show();
return app.exec();
}
add breakpoint at l.show().
start debugging
and still can't step into the Qt function QLabel::show().
What had I missed ?
Thanks a lot.
Environment:
Windows 10
Qt 5.14.1 with MSVC 2017
Microsoft Visual Studio 2019

How to solve the "no Qt platform plugin could be initialized" problem?

I'm trying to run a simple template in release mode on Visual Studio with the Qt extension. So far I've always been running projects in debug mode (never had trouble). Recently, I started with a browser application using webengine its widgets, but it's very slow on debug mode, so. I wanted to make sure it's possible to run with higher performance (on release mode), before continuing.
I was surprised, because the application throws 4 error message pop-ups after each other after trying to run it:
The procedure entry point ?endl#QTextStreamFunctions##YAAEAVQTextStream##AEAV2##Z could not be located in the dynamic link library C:\Qt\5.14.1\msvc2017_64\bin\Qt5WebChannel.dll.
The procedure entry point ?argToQString#QQtPrivate...QString...QStringView... could not be located in the dynamic link library C:\Qt\5.14.1\msvc2017_64\bin\Qt5WebChannel.dll.
Two more similar ones for QDebug and QRhiDepthStencilClearValue.
So instead, I tried to compile a simple project (the direct QtWidgetsApplication template) and it gave me this:
This application failed to start because no Qt Platform plugin could be initialized. Reinstalling the application may fix this problem.
I've been looking for a solution for quite some time now, but I didn't find a clear answer.
My directory: C:\Qt\5.14.1\msvc2017_64
My template code:
#include "QtWidgetsApplication2.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QtWidgetsApplication2 w;
w.show();
return a.exec();
}
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_QtWidgetsApplication2.h"
class QtWidgetsApplication2 : public QMainWindow
{
Q_OBJECT
public:
QtWidgetsApplication2(QWidget *parent = Q_NULLPTR);
private:
Ui::QtWidgetsApplication2Class ui;
};
#include "QtWidgetsApplication2.h"
QtWidgetsApplication2::QtWidgetsApplication2(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
}
I have no clue of how to fix this problem. Could you please help me out? Thanks in advance!
See if this helps.
Are you trying to start the program by double clicking the .exe ?
I tried to reproduce it:
build a simple project in release mode
run windeployqt ... and delete the generated folder ./platforms
double click on .exe to run it.
and prompts the error message you got.

C++ compile problems with Qt for Visual Studio 2017

I have installed Qt Creator with the msvc2017_64 binary. I also installed the Qt add-in for VS2017. I can create a QtGuiApplication without any problems, but when i try to compile it, many errors appear. I listed them here, on pastebin, because I cannot add this many characters to Stackoverflow. I'm sorry for that.
Do I need any essential packages for this? I installed C++ for VS2017 ofc. I also included the QtPath in the Qt VS Tools menu.
I did not edit the files since project creation and compiling fails due to errors.
EDIT: This problem is solved here. But not only the Errors form Pastebin exist, also the one following in the QtGuiApplication.h
QtGuiApplication.h: (Errors marked as comments)
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_QtGuiApplication1.h" //This could not be found
class QtGuiApplication1 : public QMainWindow
{
Q_OBJECT
public:
QtGuiApplication1(QWidget *parent = Q_NULLPTR);
private:
Ui::QtGuiApplication1Class ui; //Ui namespace does not exist
};
QtApplication.cpp:
#include "stdafx.h"
#include "QtGuiApplication1.h"
QtGuiApplication1::QtGuiApplication1(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
}
main.cpp:
#include "stdafx.h"
#include "QtGuiApplication1.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QtGuiApplication1 w;
w.show();
return a.exec();
}
I solved this problem myself!
The Qt add-in creates the Project with the Windowns 8.1 SDK, you need to retarget it to the Win 10 SDK to get the compile Errors from the QtGuiApplication.h away. Even if the 8.1 SDK is installed. Seems like a bug.
The solution was quite simple to me, just unload and then reload the solution from Solution Explorer!
This will clear all c++ compiler errors! Don't know why ...

Qt4.8.1 undhandled exception at QMdiArea::addSubwindow

I compiled Qt 4.8.1 with these instructions:
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
for my system (Visual Studio 2010, x64). The compilation worked and everything seemed Ok.
While compiling there is a lot of output, but it's very fast and therefore I can't read it so i suppose that shouldn't be a problem.
After I compiled succesfully my current project I got an unhandled runtime exception. After a while I discovered that it comes from the QMdiArea::addSubwindow function, which seems to throw the exception (I'm not able to catch it with overriden notify function though). So I searched for an example project to see if it's my code or something else. I found this example here:
http://www.codeprogress.com/cpp/libraries/qt/qMdiAreaAddSubWindow.php
And it works fine in 32bit mode as well as debug mode of x64, but again at the
QMdiArea::addSubwindow function there is an unhandled exception. Has anyone an idea what's wrong or had the same problem?
Currently I'm recompiling Qt to get the debug information again (i cleaned it beforehand).
But maybe someone had the same problem and a solution for me.
//Update:
The code is here (the exact same as in the link)
#include <QApplication>
#include <QMainWindow>
#include <QMdiArea>
#include <QMdiSubWindow>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QMainWindow window;
window.setFixedSize(800,600);
window.setWindowTitle(QString::fromUtf8("My QMdiWindow"));
QMdiArea* area = new QMdiArea();
area->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
//Create QMdiSubWindow
QMdiSubWindow* subWindow = new QMdiSubWindow();
subWindow->setFixedSize(200,100);
//Add subWindow to Main QMdiWindow here
area->addSubWindow(subWindow);
window.setCentralWidget(area);
window.show();
return app.exec();
}
//Update2:
I opened another discussion here.
Ok, I found the problem. It is a bug in the MSVC++ compiler. Installing the service pack and recompiling Qt again helps.